Commit f02c7f20 authored by 何虹's avatar 何虹 💬

编译成es5

parent 8a18c7ac
......@@ -8,16 +8,13 @@
else
root["hsWebHttpClient"] = factory();
})(self, function() {
return /******/ (() => { // webpackBootstrap
return /******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _root__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
/* harmony import */ var _packages_modules_billflow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28);
/* harmony import */ var _packages_modules_webChartConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
......@@ -53,23 +50,20 @@ root_prototype_keys.forEach(k => {
api[`${k}`] = root_prototype[k]
}
})
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (api);
/* harmony default export */ __webpack_exports__["default"] = (api);
/***/ }),
/* 1 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
class Root {
filterEmptyValue(obj) {
filterEmptyValue (obj) {
if (!obj) return
const emptyValues = [null, undefined, 'null', 'undefined', NaN]
for (const k in obj) {
......@@ -81,25 +75,28 @@ class Root {
}
}
}
get(url, params, headers, config) {
get (url, params, headers, config) {
return this.request('get', url, null, params, headers, config)
}
post(url, data, params, headers, config) {
post (url, data, params, headers, config) {
return this.request('post', url, data, params, headers, config)
}
put(url, data, params, headers, config) {
put (url, data, params, headers, config) {
return this.request('put', url, data, params, headers, config)
}
delete(url, data, params, headers, config) {
delete (url, data, params, headers, config) {
return this.request('delete', url, data, params, headers, config)
}
requestConfig(config) {
requestConfig (config) {
return axios__WEBPACK_IMPORTED_MODULE_0___default()(config)
}
request(method, url, data, params, headers = null, config = {}) {
request (method, url, data, params, headers = null, config = {}) {
this.filterEmptyValue(data)
// 公共头设置
const aixosCtx = { method, url, ...config }
const aixosCtx = { method, url,...config }
// if (config) {
// Object.assign(aixosCtx, config)
// }
params && (aixosCtx.params = params)
if (aixosCtx.params && aixosCtx.params.token) delete aixosCtx.params.token
if (aixosCtx.params && aixosCtx.params._user_info) delete aixosCtx.params._user_info
......@@ -110,18 +107,18 @@ class Root {
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Root);
/* harmony default export */ __webpack_exports__["default"] = (Root);
/***/ }),
/* 2 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__(3);
/***/ }),
/* 3 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -181,7 +178,7 @@ module.exports.default = axios;
/***/ }),
/* 4 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -539,7 +536,7 @@ module.exports = {
/***/ }),
/* 5 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -557,7 +554,7 @@ module.exports = function bind(fn, thisArg) {
/***/ }),
/* 6 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -659,7 +656,7 @@ module.exports = Axios;
/***/ }),
/* 7 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -736,7 +733,7 @@ module.exports = function buildURL(url, params, paramsSerializer) {
/***/ }),
/* 8 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -795,7 +792,7 @@ module.exports = InterceptorManager;
/***/ }),
/* 9 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -881,7 +878,7 @@ module.exports = function dispatchRequest(config) {
/***/ }),
/* 10 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -908,7 +905,7 @@ module.exports = function transformData(data, headers, fns) {
/***/ }),
/* 11 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -920,7 +917,7 @@ module.exports = function isCancel(value) {
/***/ }),
/* 12 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1025,7 +1022,7 @@ module.exports = defaults;
/***/ }),
/* 13 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1044,7 +1041,7 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
/***/ }),
/* 14 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1230,7 +1227,7 @@ module.exports = function xhrAdapter(config) {
/***/ }),
/* 15 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1262,7 +1259,7 @@ module.exports = function settle(resolve, reject, response) {
/***/ }),
/* 16 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1287,7 +1284,7 @@ module.exports = function createError(message, config, code, request, response)
/***/ }),
/* 17 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -1336,7 +1333,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
/***/ }),
/* 18 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1396,7 +1393,7 @@ module.exports = (
/***/ }),
/* 19 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1423,7 +1420,7 @@ module.exports = function buildFullPath(baseURL, requestedURL) {
/***/ }),
/* 20 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -1444,7 +1441,7 @@ module.exports = function isAbsoluteURL(url) {
/***/ }),
/* 21 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -1465,7 +1462,7 @@ module.exports = function combineURLs(baseURL, relativeURL) {
/***/ }),
/* 22 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1525,7 +1522,7 @@ module.exports = function parseHeaders(headers) {
/***/ }),
/* 23 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1600,7 +1597,7 @@ module.exports = (
/***/ }),
/* 24 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1694,7 +1691,7 @@ module.exports = function mergeConfig(config1, config2) {
/***/ }),
/* 25 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -1720,7 +1717,7 @@ module.exports = Cancel;
/***/ }),
/* 26 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
......@@ -1784,7 +1781,7 @@ module.exports = CancelToken;
/***/ }),
/* 27 */
/***/ ((module) => {
/***/ (function(module) {
"use strict";
......@@ -1818,13 +1815,10 @@ module.exports = function spread(callback) {
/***/ }),
/* 28 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _common_commonModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29);
// 单据流类
......@@ -1862,30 +1856,30 @@ class Billflow {
return this.requestClient.post(url, data)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Billflow);
/* harmony default export */ __webpack_exports__["default"] = (Billflow);
/***/ }),
/* 29 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "WEB_QUERY": () => /* binding */ WEB_QUERY,
/* harmony export */ "WEB_QUERY_QUERY": () => /* binding */ WEB_QUERY_QUERY,
/* harmony export */ "WEB_QUERY_QUERY_VALUE": () => /* binding */ WEB_QUERY_QUERY_VALUE,
/* harmony export */ "WEB_QUERY_PAGE": () => /* binding */ WEB_QUERY_PAGE,
/* harmony export */ "SQL_GQL": () => /* binding */ SQL_GQL,
/* harmony export */ "SQL_GQL_SAVE": () => /* binding */ SQL_GQL_SAVE,
/* harmony export */ "TOOL_API": () => /* binding */ TOOL_API,
/* harmony export */ "AUDIT_BILLS": () => /* binding */ AUDIT_BILLS,
/* harmony export */ "UN_AUDIT_BILLS": () => /* binding */ UN_AUDIT_BILLS,
/* harmony export */ "CLOSE_BILLS": () => /* binding */ CLOSE_BILLS,
/* harmony export */ "UN_CLOSE_BILLS": () => /* binding */ UN_CLOSE_BILLS,
/* harmony export */ "SEND_BILLS": () => /* binding */ SEND_BILLS,
/* harmony export */ "UN_SEND_BILLS": () => /* binding */ UN_SEND_BILLS,
/* harmony export */ "REJECT_BILLS": () => /* binding */ REJECT_BILLS
/* harmony export */ "WEB_QUERY": function() { return /* binding */ WEB_QUERY; },
/* harmony export */ "WEB_QUERY_QUERY": function() { return /* binding */ WEB_QUERY_QUERY; },
/* harmony export */ "WEB_QUERY_QUERY_VALUE": function() { return /* binding */ WEB_QUERY_QUERY_VALUE; },
/* harmony export */ "WEB_QUERY_PAGE": function() { return /* binding */ WEB_QUERY_PAGE; },
/* harmony export */ "SQL_GQL": function() { return /* binding */ SQL_GQL; },
/* harmony export */ "SQL_GQL_SAVE": function() { return /* binding */ SQL_GQL_SAVE; },
/* harmony export */ "TOOL_API": function() { return /* binding */ TOOL_API; },
/* harmony export */ "AUDIT_BILLS": function() { return /* binding */ AUDIT_BILLS; },
/* harmony export */ "UN_AUDIT_BILLS": function() { return /* binding */ UN_AUDIT_BILLS; },
/* harmony export */ "CLOSE_BILLS": function() { return /* binding */ CLOSE_BILLS; },
/* harmony export */ "UN_CLOSE_BILLS": function() { return /* binding */ UN_CLOSE_BILLS; },
/* harmony export */ "SEND_BILLS": function() { return /* binding */ SEND_BILLS; },
/* harmony export */ "UN_SEND_BILLS": function() { return /* binding */ UN_SEND_BILLS; },
/* harmony export */ "REJECT_BILLS": function() { return /* binding */ REJECT_BILLS; }
/* harmony export */ });
/* harmony import */ var _commonProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
......@@ -1908,18 +1902,18 @@ const REJECT_BILLS = `${_commonProxy__WEBPACK_IMPORTED_MODULE_0__.COMMON_UTIL_PR
/***/ }),
/* 30 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "OAUTH_PROXY": () => /* binding */ OAUTH_PROXY,
/* harmony export */ "TOOL_PROXY": () => /* binding */ TOOL_PROXY,
/* harmony export */ "HSRIGHT_TOOL_PROXY": () => /* binding */ HSRIGHT_TOOL_PROXY,
/* harmony export */ "COMMON_UTIL_PROXY": () => /* binding */ COMMON_UTIL_PROXY,
/* harmony export */ "COMMON_PROXY": () => /* binding */ COMMON_PROXY,
/* harmony export */ "GQL_PROXY": () => /* binding */ GQL_PROXY,
/* harmony export */ "FILE_RESOURCE_PROXY": () => /* binding */ FILE_RESOURCE_PROXY
/* harmony export */ "OAUTH_PROXY": function() { return /* binding */ OAUTH_PROXY; },
/* harmony export */ "TOOL_PROXY": function() { return /* binding */ TOOL_PROXY; },
/* harmony export */ "HSRIGHT_TOOL_PROXY": function() { return /* binding */ HSRIGHT_TOOL_PROXY; },
/* harmony export */ "COMMON_UTIL_PROXY": function() { return /* binding */ COMMON_UTIL_PROXY; },
/* harmony export */ "COMMON_PROXY": function() { return /* binding */ COMMON_PROXY; },
/* harmony export */ "GQL_PROXY": function() { return /* binding */ GQL_PROXY; },
/* harmony export */ "FILE_RESOURCE_PROXY": function() { return /* binding */ FILE_RESOURCE_PROXY; }
/* harmony export */ });
const OAUTH_PROXY = 'OAUTH_PROXY'// `http://${api}/HSRight/api/`
const TOOL_PROXY = 'TOOL_PROXY' // `http://${api}/Tool/api/`
......@@ -1932,13 +1926,10 @@ const FILE_RESOURCE_PROXY = 'FILE_RESOURCE_PROXY'// `http://${api}/fileresource/
/***/ }),
/* 31 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _common_commonModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29);
/* harmony import */ var hs_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
/* harmony import */ var hs_util_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(hs_util_js__WEBPACK_IMPORTED_MODULE_1__);
......@@ -2108,12 +2099,12 @@ class Control {
return this.requestClient.post(_common_commonModule__WEBPACK_IMPORTED_MODULE_0__.WEB_QUERY_PAGE, postData)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Control);
/* harmony default export */ __webpack_exports__["default"] = (Control);
/***/ }),
/* 32 */
/***/ ((module) => {
/***/ (function(module) {
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
......@@ -21956,13 +21947,10 @@ class TypeObject {
/***/ }),
/* 33 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _common_commonModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29);
class RestFul {
......@@ -22029,18 +22017,15 @@ class RestFul {
return this.requestClient.delete(url_, bodyData, parms)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RestFul);
/* harmony default export */ __webpack_exports__["default"] = (RestFul);
/***/ }),
/* 34 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _common_commonProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
......@@ -22102,18 +22087,15 @@ class System {
return this.restfulClient.queryList(data)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (System);
/* harmony default export */ __webpack_exports__["default"] = (System);
/***/ }),
/* 35 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _common_commonModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29);
class WebQuery {
......@@ -22128,18 +22110,15 @@ class WebQuery {
return this.requestClient.post(_common_commonModule__WEBPACK_IMPORTED_MODULE_0__.WEB_QUERY_PAGE, data, params, header)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WebQuery);
/* harmony default export */ __webpack_exports__["default"] = (WebQuery);
/***/ }),
/* 36 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__
/* harmony export */ });
/* harmony import */ var _common_commonProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
......@@ -22157,7 +22136,7 @@ class Ref {
return this.requestClient.get(url, parms)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Ref);
/* harmony default export */ __webpack_exports__["default"] = (Ref);
/***/ })
......@@ -22188,44 +22167,44 @@ class Ref {
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ () => module['default'] :
/******/ () => module;
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
/******/ })();
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/ }();
/******/
/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,7 +2,7 @@
"name": "hswebhttpclient",
"version": "1.0.3",
"description": "dync中httpClient基础插件",
"main": "./src/index.js",
"main": "./dist/hsWebHttpClient.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack",
......
import axios from 'axios'
class Root {
filterEmptyValue(obj) {
filterEmptyValue (obj) {
if (!obj) return
const emptyValues = [null, undefined, 'null', 'undefined', NaN]
for (const k in obj) {
......@@ -12,25 +12,28 @@ class Root {
}
}
}
get(url, params, headers, config) {
get (url, params, headers, config) {
return this.request('get', url, null, params, headers, config)
}
post(url, data, params, headers, config) {
post (url, data, params, headers, config) {
return this.request('post', url, data, params, headers, config)
}
put(url, data, params, headers, config) {
put (url, data, params, headers, config) {
return this.request('put', url, data, params, headers, config)
}
delete(url, data, params, headers, config) {
delete (url, data, params, headers, config) {
return this.request('delete', url, data, params, headers, config)
}
requestConfig(config) {
requestConfig (config) {
return axios(config)
}
request(method, url, data, params, headers = null, config = {}) {
request (method, url, data, params, headers = null, config = {}) {
this.filterEmptyValue(data)
// 公共头设置
const aixosCtx = { method, url, ...config }
const aixosCtx = { method, url,...config }
// if (config) {
// Object.assign(aixosCtx, config)
// }
params && (aixosCtx.params = params)
if (aixosCtx.params && aixosCtx.params.token) delete aixosCtx.params.token
if (aixosCtx.params && aixosCtx.params._user_info) delete aixosCtx.params._user_info
......
......@@ -2,6 +2,7 @@ const TerserPlugin = require('terser-webpack-plugin') // 引入压缩插件
module.exports = {
mode: 'none', // 因为默认是production 默认会进行压缩
target: ['web', 'es5'],//← ← ←就是这个
entry: {
"hsWebHttpClient": "./src/index.js",
"hsWebHttpClient.min": "./src/index.js"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment