eoss-ui 0.5.69 → 0.5.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/button-group.js +34 -36
- package/lib/button.js +34 -36
- package/lib/checkbox-group.js +70 -56
- package/lib/data-table-form.js +37 -39
- package/lib/data-table.js +59 -59
- package/lib/date-picker.js +34 -36
- package/lib/dialog.js +49 -51
- package/lib/eoss-ui.common.js +665 -573
- package/lib/flow-group.js +34 -36
- package/lib/flow-list.js +36 -38
- package/lib/flow.js +40 -42
- package/lib/form.js +410 -376
- package/lib/handle-user.js +36 -38
- package/lib/handler.js +34 -36
- package/lib/index.js +1 -1
- package/lib/input-number.js +34 -36
- package/lib/input.js +65 -48
- package/lib/layout.js +2 -2
- package/lib/login.js +54 -55
- package/lib/main.js +39 -41
- package/lib/menu.js +5 -4
- package/lib/nav.js +34 -36
- package/lib/page.js +34 -36
- package/lib/player.js +34 -36
- package/lib/qr-code.js +34 -36
- package/lib/radio-group.js +69 -53
- package/lib/retrial-auth.js +34 -36
- package/lib/select-ganged.js +122 -106
- package/lib/select.js +115 -105
- package/lib/selector-panel.js +90 -76
- package/lib/selector.js +34 -36
- package/lib/sizer.js +36 -38
- package/lib/steps.js +60 -44
- package/lib/switch.js +34 -36
- package/lib/table-form.js +36 -38
- package/lib/tabs.js +34 -36
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/tips.js +59 -42
- package/lib/tree-group.js +34 -36
- package/lib/tree.js +93 -77
- package/lib/upload.js +111 -94
- package/lib/utils/util.js +34 -36
- package/lib/wujie.js +34 -36
- package/lib/wxlogin.js +34 -36
- package/package.json +2 -2
- package/packages/checkbox-group/src/main.vue +7 -1
- package/packages/data-table/src/main.vue +4 -2
- package/packages/dialog/src/main.vue +2 -3
- package/packages/form/src/main.vue +11 -2
- package/packages/input/src/main.vue +8 -1
- package/packages/login/src/main.vue +15 -11
- package/packages/menu/src/main.vue +3 -2
- package/packages/radio-group/src/main.vue +7 -1
- package/packages/select/src/main.vue +10 -10
- package/packages/select-ganged/src/main.vue +7 -1
- package/packages/selector-panel/src/main.vue +7 -1
- package/packages/steps/src/main.vue +9 -3
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/login.css +1 -1
- package/packages/theme-chalk/src/login.scss +1 -1
- package/packages/tips/src/main.vue +8 -1
- package/packages/tree/src/main.vue +8 -2
- package/packages/upload/src/main.vue +11 -2
- package/src/index.js +1 -1
- package/src/utils/util.js +34 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.es-login-screen{width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover;position:relative;overflow:hidden}.es-login-screen .es-login-logo{height:58px;position:absolute;left:24px;top:24px}.es-login{width:540px;position:absolute;padding:0 12px}.es-login .es-login-name{display:block;margin-bottom:56px;position:relative;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.es-login .es-login-main{padding:60px
|
|
1
|
+
@charset "UTF-8";.es-login-screen{width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover;position:relative;overflow:hidden}.es-login-screen .es-login-logo{height:58px;position:absolute;left:24px;top:24px}.es-login{width:540px;position:absolute;padding:0 12px}.es-login .es-login-name{display:block;margin-bottom:56px;position:relative;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.es-login .es-login-main{padding:60px 70px;position:relative;border-radius:20px;background-size:100% 100%;background-color:#fff;background-repeat:no-repeat;-webkit-box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08)}.es-login .es-login-main .es-login-title-image{margin:-60px -80px 30px}.es-login .es-login-main .es-login-title-image .es-login-title-img{width:100%}.es-login .es-login-main .es-login-switch{position:absolute;right:10px;top:10px;overflow:hidden;z-index:99}.es-login .es-login-main .es-login-switch .es-icon{font-size:60px;color:#1890ff;cursor:pointer;position:relative;top:-1px}.es-login .es-login-main .es-login-switch .es-icon::after{content:'';position:absolute;left:0;top:0;border-color:transparent transparent #fff #fff;border-style:solid;border-width:30px}.es-login .es-login-main .es-login-switchs{position:absolute;bottom:0;left:0;right:0;text-align:center;padding-bottom:16px;color:#d9d9d9;z-index:99}.es-login .es-login-main .es-login-switchs .es-icon{font-size:24px;cursor:pointer}.es-login .es-login-main .es-login-switchs .es-icon+.es-icon{margin-left:12px}.es-login .es-login-main .es-login-switchs .es-icon.es-icon-active{color:#1890ff}.es-login .es-login-main .es-downloadSetup{font-size:14px;text-align:center;line-height:18px;padding-bottom:12px}.es-login .es-login-main .es-downloadSetup span{cursor:pointer;color:#333}.es-login .es-login-main .es-downloadSetup span:hover{color:#f9d900}.es-login .es-login-main .es-warning{color:#a90404;line-height:18px;font-size:16px;text-align:center;padding-bottom:12px}.es-login .es-login-title{color:#1890ff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:24px;font-size:24px;line-height:24px;font-weight:700;margin-bottom:48px;position:relative}.es-login .es-login-title::after,.es-login .es-login-title::before{content:'';height:1px;-webkit-box-flex:1;-ms-flex:1;flex:1;background-color:#eee}.es-login .es-login-title .es-login-title-content{margin:0 24px}.es-login .es-login-form{border-radius:20px;background-color:rgba(255,255,255,.3);position:relative;padding-bottom:20px}.es-login .es-login-form .el-form-item{margin-bottom:32px}.es-login .es-login-form .el-form-item__content{line-height:normal}.es-login .es-login-form .el-form-item__error{font-size:14px}.es-login .es-login-form .el-input__clear{font-size:18px}.es-login .es-login-form .el-input__inner{height:50px;font-size:18px;background-color:#f7f7f7;border-radius:10px;padding-left:52px}.es-login .es-login-form .el-input__inner::-webkit-input-placeholder{font-size:16px}.es-login .es-login-form .el-input__inner:-moz-placeholder{font-size:16px}.es-login .es-login-form .el-input__inner::-moz-placeholder{font-size:16px}.es-login .es-login-form .el-input__inner:-ms-input-placeholder{font-size:16px}.es-login .es-login-form .el-input__prefix{left:20px;line-height:52px}.es-login .es-login-form .es-label-user{font-size:18px;color:#333}.es-login .es-login-form .es-label-password{font-size:22px;color:#333;position:relative;top:2px}.es-login .es-login-form .es-label-image-code{padding-right:120px}.es-login .es-login-form .es-label-image-code .el-input__suffix{padding:5px;right:0}.es-login .es-login-form .es-label-image-code .es-img-code{cursor:pointer}.es-login .es-login-form .es-label-image-code .es-get-code{margin-top:-5px;margin-bottom:-5px;line-height:32px;font-size:16px;padding:8px 16px}.es-login .es-login-form .es-label-code-image{font-size:20px;color:#333;line-height:50px}.es-login .es-login-form .es-password-handle{height:22px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:-8px;margin-bottom:40px}.es-login .es-login-form .es-password-handle .el-checkbox__label{font-size:16px;font-weight:400;color:#333!important}.es-login .es-login-form .es-password-handle .el-checkbox__input .el-checkbox__inner{width:18px;height:18px;border-radius:10px}.es-login .es-login-form .es-password-handle .el-checkbox__input .el-checkbox__inner::after{border:2px solid #fff;border-left:0;border-top:0;height:8px;left:6px;top:2px}.es-login .es-login-form .es-password-handle .es-password-forget{font-size:16px;color:#999;text-align:right;float:right;cursor:pointer}.es-login .es-login-form .es-button-submit{width:100%;height:50px;font-size:20px;font-weight:500;border-radius:10px}.es-login .es-login-form.es-login-verify .es-login-title{margin-bottom:70px}.es-login .es-login-form.es-login-verify .el-form-item{margin-bottom:62px}.es-login .es-login-form .el-autocomplete{width:100%}.es-login .es-login-qrcode .es-login-down-app{font-size:14px;font-weight:400;text-align:center;line-height:20px}.es-login .es-login-qrcode .es-login-down-app .es-login-app-name{color:#a90404;padding:0 8px}.es-login .es-login-qrcode .es-qrcode-box,.es-login .es-login-qrcode .es-wx-qrcode-box{padding-top:25px;padding-bottom:25px}.es-login .es-login-qrcode .es-qrcode-img{border:1px solid #d9d9d9}.es-login.es-simple .es-login-form .el-input__inner{border-width:0 0 1px;border-radius:0;background-color:#fff;padding-left:32px;padding-right:16px;-webkit-box-shadow:none;box-shadow:none}.es-login.es-simple .es-login-form .el-input__inner::-webkit-input-placeholder{font-size:16px;color:#999}.es-login.es-simple .es-login-form .el-input__inner:-moz-placeholder{font-size:16px;color:#999}.es-login.es-simple .es-login-form .el-input__inner::-moz-placeholder{font-size:16px;color:#999}.es-login.es-simple .es-login-form .el-input__inner:-ms-input-placeholder{font-size:16px;color:#999}.es-login.es-simple .el-input__prefix{left:0}@media screen and (max-width:1600px){.es-login{width:428px;padding:0 8px}.es-login .es-login-logo{height:42px;left:20px;top:20px}.es-login .es-login-name{margin-bottom:40px}.es-login .es-login-main{padding:40px 44px}.es-login .es-login-main .es-login-switch{right:24px;top:24px}.es-login .es-login-main .es-login-switch .es-icon{font-size:60px}.es-login .es-login-main .es-login-switch .es-icon::after{left:-10px;border-width:30px}.es-login .es-login-main .es-warning{font-size:14px}.es-login .es-login-title{height:22px;margin-bottom:36px;font-size:18px;line-height:22px}.es-login .es-login-title .es-login-title-content{margin:0 12px}.es-login .es-login-form .el-input__inner{padding-left:40px;height:44px;line-height:44px;font-size:13px}.es-login .es-login-form .el-input__inner::-webkit-input-placeholder{font-size:13px}.es-login .es-login-form .el-input__prefix{left:16px;line-height:36px}.es-login .es-login-form .es-label-user{font-size:14px}.es-login .es-login-form .es-label-password{font-size:16px;top:0}.es-login .es-login-form .el-input__clear{font-size:14px;line-height:36px}.es-login .es-login-form .es-label-code-image{font-size:16px;line-height:36px}.es-login .es-login-form .el-form-item__error,.es-login .es-login-form .es-password-handle .el-checkbox__label,.es-login .es-login-form .es-password-handle .es-password-forget{font-size:12px}.es-login .es-login-form .es-label-image-code{padding-right:100px}.es-login .es-login-form .es-label-image-code .el-input__suffix{padding:2px}.es-login .es-login-form .es-label-image-code .el-input__suffix .es-get-code{margin-top:-2px;margin-bottom:-2px;padding:5px 6px}.es-login .es-login-form .es-label-image-code .es-img-code{height:32px}.es-login .es-login-form .es-password-handle{margin-top:0;margin-bottom:20px}.es-login .es-login-form .es-password-handle .el-checkbox__input .el-checkbox__inner{width:14px;height:14px;top:1px;padding-left:6px}.es-login .es-login-form .es-password-handle .el-checkbox__input .el-checkbox__inner::after{left:4px;top:0}.es-login .es-login-form .es-password-handle .el-checkbox__input.is-checked .el-checkbox__inner::after{-webkit-transform:rotate(45deg) scaleY(.9);transform:rotate(45deg) scaleY(.9)}.es-login .es-login-form .extra{margin-top:20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.es-login .es-login-form .extra span{cursor:pointer;font-size:14px;color:#12278b}.es-login .es-login-form .es-button-submit{height:44px;line-height:44px;font-size:16px;padding:0 8px;border-radius:8px}.es-login .es-login-form.es-login-verify .es-login-title{margin-bottom:68px}.es-login .es-login-form.es-login-verify .el-form-item{margin-bottom:54px}.es-login .es-login-qrcode .es-login-title{margin-bottom:18px}.es-login .es-login-qrcode .es-qrcode-box,.es-login .es-login-qrcode .es-wx-qrcode-box{padding-top:16px;padding-bottom:16px}}.es-user-info .es-form-content{padding-right:30px}.es-user-info .es-form-button{padding-right:20px}.es-login-icp{display:-webkit-box;display:-ms-flexbox;display:flex;position:fixed;left:50%;bottom:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.es-login-icp .es-login-icp-item{display:block;white-space:nowrap;font-size:14px;font-weight:400}.es-login-icp .es-login-icp-item+.es-login-icp-item{margin-left:20px}.es-login-icp a:hover{text-decoration:underline}.rest-password-box{height:100%;position:relative}.rest-password-box.rest-password-cut{padding-top:60px}.rest-password-box .rest-menu-cut{position:absolute;left:0;top:0;right:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}
|
package/lib/tips.js
CHANGED
|
@@ -154,21 +154,17 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
|
|
|
154
154
|
* @param {Array} [encodes] - 需要对参数值进行encodeURIComponent编码的参数值名称
|
|
155
155
|
**/
|
|
156
156
|
// 请求
|
|
157
|
-
|
|
158
|
-
function getRequestKey(config) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (pendingRequest.has(requestKey)) {
|
|
169
|
-
pendingRequest.delete(requestKey);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
157
|
+
// const pendingRequest = new Map();
|
|
158
|
+
// function getRequestKey(config) {
|
|
159
|
+
// const { method, url, params, data } = config;
|
|
160
|
+
// return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
161
|
+
// };
|
|
162
|
+
// function delPendingRequest(config) {
|
|
163
|
+
// let requestKey = getRequestKey(config);
|
|
164
|
+
// if (pendingRequest.has(requestKey)) {
|
|
165
|
+
// pendingRequest.delete(requestKey);
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
172
168
|
var ajax = function ajax(_ref) {
|
|
173
169
|
var headers = _ref.headers,
|
|
174
170
|
method = _ref.method,
|
|
@@ -217,30 +213,32 @@ var ajax = function ajax(_ref) {
|
|
|
217
213
|
http.interceptors.request.use(function (config) {
|
|
218
214
|
config.headers.common = getStorage();
|
|
219
215
|
// 根据请求的信息(请求方式,url,请求get/post数据),产生map的key
|
|
220
|
-
|
|
221
|
-
// 判断请求是否重复
|
|
222
|
-
if (pendingRequest.has(requestKey)) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
// 把请求信息,添加请求到map当中
|
|
230
|
-
// 生成取消方法
|
|
231
|
-
config.cancelToken =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
216
|
+
// let requestKey = getRequestKey(config);
|
|
217
|
+
// // 判断请求是否重复
|
|
218
|
+
// if (pendingRequest.has(requestKey)) {
|
|
219
|
+
// // 取消上次请求
|
|
220
|
+
// let cancel = pendingRequest.get(requestKey);
|
|
221
|
+
// cancel();
|
|
222
|
+
// // 删除请求信息
|
|
223
|
+
// pendingRequest.delete(requestKey);
|
|
224
|
+
// }
|
|
225
|
+
// // 把请求信息,添加请求到map当中
|
|
226
|
+
// // 生成取消方法
|
|
227
|
+
// config.cancelToken =
|
|
228
|
+
// config.cancelToken ||
|
|
229
|
+
// new axios.CancelToken(cancel => {
|
|
230
|
+
// // 把取消方法添加到map
|
|
231
|
+
// if (!pendingRequest.has(requestKey)) {
|
|
232
|
+
// pendingRequest.set(requestKey, cancel);
|
|
233
|
+
// }
|
|
234
|
+
// });
|
|
237
235
|
return config;
|
|
238
236
|
}, function (err) {
|
|
239
237
|
return err;
|
|
240
238
|
});
|
|
241
239
|
// 响应拦截
|
|
242
240
|
http.interceptors.response.use(function (response) {
|
|
243
|
-
delPendingRequest(response.config);
|
|
241
|
+
// delPendingRequest(response.config);
|
|
244
242
|
loading && loading.close();
|
|
245
243
|
if (response.headers.authorization && response.headers.authorization !== getStorage('token')) {
|
|
246
244
|
if (localStorage.getItem('storage') === 'localStorage' || localStorage.getItem('token') || localStorage.getItem('Authorization')) {
|
|
@@ -357,9 +355,9 @@ var ajax = function ajax(_ref) {
|
|
|
357
355
|
}
|
|
358
356
|
}, function (error) {
|
|
359
357
|
loading && loading.close();
|
|
360
|
-
if (!
|
|
361
|
-
|
|
362
|
-
}
|
|
358
|
+
// if (!axios.isCancel(error)) {
|
|
359
|
+
// delPendingRequest(error.config || {});
|
|
360
|
+
// }
|
|
363
361
|
if (error && error.response) {
|
|
364
362
|
if (error.response.status) {
|
|
365
363
|
switch (error.response.status) {
|
|
@@ -3497,6 +3495,13 @@ module.exports = require("sm-crypto");
|
|
|
3497
3495
|
|
|
3498
3496
|
/***/ }),
|
|
3499
3497
|
|
|
3498
|
+
/***/ 11:
|
|
3499
|
+
/***/ (function(module, exports) {
|
|
3500
|
+
|
|
3501
|
+
module.exports = require("throttle-debounce");
|
|
3502
|
+
|
|
3503
|
+
/***/ }),
|
|
3504
|
+
|
|
3500
3505
|
/***/ 2:
|
|
3501
3506
|
/***/ (function(module, exports) {
|
|
3502
3507
|
|
|
@@ -3637,7 +3642,7 @@ module.exports = require("json-bigint");
|
|
|
3637
3642
|
// ESM COMPAT FLAG
|
|
3638
3643
|
__webpack_require__.r(__webpack_exports__);
|
|
3639
3644
|
|
|
3640
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tips/src/main.vue?vue&type=template&id=
|
|
3645
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tips/src/main.vue?vue&type=template&id=6baa7a0b&
|
|
3641
3646
|
var render = function () {
|
|
3642
3647
|
var _vm = this
|
|
3643
3648
|
var _h = _vm.$createElement
|
|
@@ -3680,11 +3685,14 @@ var staticRenderFns = []
|
|
|
3680
3685
|
render._withStripped = true
|
|
3681
3686
|
|
|
3682
3687
|
|
|
3683
|
-
// CONCATENATED MODULE: ./packages/tips/src/main.vue?vue&type=template&id=
|
|
3688
|
+
// CONCATENATED MODULE: ./packages/tips/src/main.vue?vue&type=template&id=6baa7a0b&
|
|
3684
3689
|
|
|
3685
3690
|
// EXTERNAL MODULE: ./src/config/api.js
|
|
3686
3691
|
var api = __webpack_require__(1);
|
|
3687
3692
|
|
|
3693
|
+
// EXTERNAL MODULE: external "throttle-debounce"
|
|
3694
|
+
var external_throttle_debounce_ = __webpack_require__(11);
|
|
3695
|
+
|
|
3688
3696
|
// EXTERNAL MODULE: ./src/utils/util.js
|
|
3689
3697
|
var util = __webpack_require__(0);
|
|
3690
3698
|
|
|
@@ -3709,6 +3717,7 @@ var util = __webpack_require__(0);
|
|
|
3709
3717
|
|
|
3710
3718
|
|
|
3711
3719
|
|
|
3720
|
+
|
|
3712
3721
|
/* harmony default export */ var mainvue_type_script_lang_js_ = ({
|
|
3713
3722
|
name: 'EsTips',
|
|
3714
3723
|
inheritAttrs: false,
|
|
@@ -3794,6 +3803,14 @@ var util = __webpack_require__(0);
|
|
|
3794
3803
|
}
|
|
3795
3804
|
}
|
|
3796
3805
|
},
|
|
3806
|
+
beforeCreate: function beforeCreate() {
|
|
3807
|
+
var _this2 = this;
|
|
3808
|
+
|
|
3809
|
+
this.getTips = Object(external_throttle_debounce_["debounce"])(500, function () {
|
|
3810
|
+
_this2.getTipsData();
|
|
3811
|
+
});
|
|
3812
|
+
},
|
|
3813
|
+
created: function created() {},
|
|
3797
3814
|
mounted: function mounted() {
|
|
3798
3815
|
if (this.url && !this.contents && JSON.stringify(this.param) !== '{}') {
|
|
3799
3816
|
this.getTips();
|
|
@@ -3801,8 +3818,8 @@ var util = __webpack_require__(0);
|
|
|
3801
3818
|
},
|
|
3802
3819
|
|
|
3803
3820
|
methods: {
|
|
3804
|
-
|
|
3805
|
-
var
|
|
3821
|
+
getTipsData: function getTipsData() {
|
|
3822
|
+
var _this3 = this;
|
|
3806
3823
|
|
|
3807
3824
|
util["a" /* default */].ajax({
|
|
3808
3825
|
url: this.url,
|
|
@@ -3811,11 +3828,11 @@ var util = __webpack_require__(0);
|
|
|
3811
3828
|
params: this.params
|
|
3812
3829
|
}).then(function (res) {
|
|
3813
3830
|
if (res.rCode === 0) {
|
|
3814
|
-
|
|
3831
|
+
_this3.reselutContent = res;
|
|
3815
3832
|
}
|
|
3816
3833
|
}).catch(function (err) {
|
|
3817
3834
|
if (err.message && err.message !== 'canceled') {
|
|
3818
|
-
|
|
3835
|
+
_this3.$message.error(err.message);
|
|
3819
3836
|
}
|
|
3820
3837
|
});
|
|
3821
3838
|
},
|
package/lib/tree-group.js
CHANGED
|
@@ -154,21 +154,17 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
|
|
|
154
154
|
* @param {Array} [encodes] - 需要对参数值进行encodeURIComponent编码的参数值名称
|
|
155
155
|
**/
|
|
156
156
|
// 请求
|
|
157
|
-
|
|
158
|
-
function getRequestKey(config) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (pendingRequest.has(requestKey)) {
|
|
169
|
-
pendingRequest.delete(requestKey);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
157
|
+
// const pendingRequest = new Map();
|
|
158
|
+
// function getRequestKey(config) {
|
|
159
|
+
// const { method, url, params, data } = config;
|
|
160
|
+
// return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
161
|
+
// };
|
|
162
|
+
// function delPendingRequest(config) {
|
|
163
|
+
// let requestKey = getRequestKey(config);
|
|
164
|
+
// if (pendingRequest.has(requestKey)) {
|
|
165
|
+
// pendingRequest.delete(requestKey);
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
172
168
|
var ajax = function ajax(_ref) {
|
|
173
169
|
var headers = _ref.headers,
|
|
174
170
|
method = _ref.method,
|
|
@@ -217,30 +213,32 @@ var ajax = function ajax(_ref) {
|
|
|
217
213
|
http.interceptors.request.use(function (config) {
|
|
218
214
|
config.headers.common = getStorage();
|
|
219
215
|
// 根据请求的信息(请求方式,url,请求get/post数据),产生map的key
|
|
220
|
-
|
|
221
|
-
// 判断请求是否重复
|
|
222
|
-
if (pendingRequest.has(requestKey)) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
// 把请求信息,添加请求到map当中
|
|
230
|
-
// 生成取消方法
|
|
231
|
-
config.cancelToken =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
216
|
+
// let requestKey = getRequestKey(config);
|
|
217
|
+
// // 判断请求是否重复
|
|
218
|
+
// if (pendingRequest.has(requestKey)) {
|
|
219
|
+
// // 取消上次请求
|
|
220
|
+
// let cancel = pendingRequest.get(requestKey);
|
|
221
|
+
// cancel();
|
|
222
|
+
// // 删除请求信息
|
|
223
|
+
// pendingRequest.delete(requestKey);
|
|
224
|
+
// }
|
|
225
|
+
// // 把请求信息,添加请求到map当中
|
|
226
|
+
// // 生成取消方法
|
|
227
|
+
// config.cancelToken =
|
|
228
|
+
// config.cancelToken ||
|
|
229
|
+
// new axios.CancelToken(cancel => {
|
|
230
|
+
// // 把取消方法添加到map
|
|
231
|
+
// if (!pendingRequest.has(requestKey)) {
|
|
232
|
+
// pendingRequest.set(requestKey, cancel);
|
|
233
|
+
// }
|
|
234
|
+
// });
|
|
237
235
|
return config;
|
|
238
236
|
}, function (err) {
|
|
239
237
|
return err;
|
|
240
238
|
});
|
|
241
239
|
// 响应拦截
|
|
242
240
|
http.interceptors.response.use(function (response) {
|
|
243
|
-
delPendingRequest(response.config);
|
|
241
|
+
// delPendingRequest(response.config);
|
|
244
242
|
loading && loading.close();
|
|
245
243
|
if (response.headers.authorization && response.headers.authorization !== getStorage('token')) {
|
|
246
244
|
if (localStorage.getItem('storage') === 'localStorage' || localStorage.getItem('token') || localStorage.getItem('Authorization')) {
|
|
@@ -357,9 +355,9 @@ var ajax = function ajax(_ref) {
|
|
|
357
355
|
}
|
|
358
356
|
}, function (error) {
|
|
359
357
|
loading && loading.close();
|
|
360
|
-
if (!
|
|
361
|
-
|
|
362
|
-
}
|
|
358
|
+
// if (!axios.isCancel(error)) {
|
|
359
|
+
// delPendingRequest(error.config || {});
|
|
360
|
+
// }
|
|
363
361
|
if (error && error.response) {
|
|
364
362
|
if (error.response.status) {
|
|
365
363
|
switch (error.response.status) {
|