eoss-ui 0.5.69 → 0.5.70
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 +58 -58
- package/lib/date-picker.js +34 -36
- package/lib/dialog.js +49 -51
- package/lib/eoss-ui.common.js +660 -562
- 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 +4 -3
- 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 +112 -96
- 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/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 +3 -1
- 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 +2 -1
- package/packages/radio-group/src/main.vue +7 -1
- package/packages/select/src/main.vue +7 -1
- 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/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
package/src/utils/util.js
CHANGED
|
@@ -49,17 +49,17 @@ import { MessageBox, Loading } from 'eoss-element';
|
|
|
49
49
|
* @param {Array} [encodes] - 需要对参数值进行encodeURIComponent编码的参数值名称
|
|
50
50
|
**/
|
|
51
51
|
// 请求
|
|
52
|
-
const pendingRequest = new Map();
|
|
53
|
-
function getRequestKey(config) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
function delPendingRequest(config) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
52
|
+
// const pendingRequest = new Map();
|
|
53
|
+
// function getRequestKey(config) {
|
|
54
|
+
// const { method, url, params, data } = config;
|
|
55
|
+
// return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
56
|
+
// };
|
|
57
|
+
// function delPendingRequest(config) {
|
|
58
|
+
// let requestKey = getRequestKey(config);
|
|
59
|
+
// if (pendingRequest.has(requestKey)) {
|
|
60
|
+
// pendingRequest.delete(requestKey);
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
63
63
|
const ajax = function ({
|
|
64
64
|
headers,
|
|
65
65
|
method,
|
|
@@ -104,25 +104,25 @@ const ajax = function ({
|
|
|
104
104
|
config => {
|
|
105
105
|
config.headers.common = getStorage();
|
|
106
106
|
// 根据请求的信息(请求方式,url,请求get/post数据),产生map的key
|
|
107
|
-
let requestKey = getRequestKey(config);
|
|
108
|
-
// 判断请求是否重复
|
|
109
|
-
if (pendingRequest.has(requestKey)) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
// 把请求信息,添加请求到map当中
|
|
117
|
-
// 生成取消方法
|
|
118
|
-
config.cancelToken =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
107
|
+
// let requestKey = getRequestKey(config);
|
|
108
|
+
// // 判断请求是否重复
|
|
109
|
+
// if (pendingRequest.has(requestKey)) {
|
|
110
|
+
// // 取消上次请求
|
|
111
|
+
// let cancel = pendingRequest.get(requestKey);
|
|
112
|
+
// cancel();
|
|
113
|
+
// // 删除请求信息
|
|
114
|
+
// pendingRequest.delete(requestKey);
|
|
115
|
+
// }
|
|
116
|
+
// // 把请求信息,添加请求到map当中
|
|
117
|
+
// // 生成取消方法
|
|
118
|
+
// config.cancelToken =
|
|
119
|
+
// config.cancelToken ||
|
|
120
|
+
// new axios.CancelToken(cancel => {
|
|
121
|
+
// // 把取消方法添加到map
|
|
122
|
+
// if (!pendingRequest.has(requestKey)) {
|
|
123
|
+
// pendingRequest.set(requestKey, cancel);
|
|
124
|
+
// }
|
|
125
|
+
// });
|
|
126
126
|
return config;
|
|
127
127
|
},
|
|
128
128
|
err => {
|
|
@@ -132,7 +132,7 @@ const ajax = function ({
|
|
|
132
132
|
// 响应拦截
|
|
133
133
|
http.interceptors.response.use(
|
|
134
134
|
response => {
|
|
135
|
-
delPendingRequest(response.config);
|
|
135
|
+
// delPendingRequest(response.config);
|
|
136
136
|
loading && loading.close();
|
|
137
137
|
if (
|
|
138
138
|
response.headers.authorization &&
|
|
@@ -301,9 +301,9 @@ const ajax = function ({
|
|
|
301
301
|
},
|
|
302
302
|
error => {
|
|
303
303
|
loading && loading.close();
|
|
304
|
-
if (!axios.isCancel(error)) {
|
|
305
|
-
|
|
306
|
-
}
|
|
304
|
+
// if (!axios.isCancel(error)) {
|
|
305
|
+
// delPendingRequest(error.config || {});
|
|
306
|
+
// }
|
|
307
307
|
if (error && error.response) {
|
|
308
308
|
if (error.response.status) {
|
|
309
309
|
switch (error.response.status) {
|