@10yun/cv-pc-ui 0.2.46 → 0.2.48
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/cv-pc-ui.common.js +161 -331
- package/lib/cv-pc-ui.common.js.map +1 -1
- package/lib/cv-pc-ui.umd.js +161 -331
- package/lib/cv-pc-ui.umd.js.map +1 -1
- package/lib/cv-pc-ui.umd.min.js +1 -1
- package/lib/cv-pc-ui.umd.min.js.map +1 -1
- package/package.json +4 -4
- package/plugins/request.js +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10yun/cv-pc-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.48",
|
|
4
4
|
"description": "cvjs-pc-ui组件",
|
|
5
5
|
"author": "10yun",
|
|
6
6
|
"private": false,
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"async-validator": "^4.2.5",
|
|
40
|
-
"core-js": "^3.26.
|
|
41
|
-
"element-ui": "^2.15.
|
|
40
|
+
"core-js": "^3.26.1",
|
|
41
|
+
"element-ui": "^2.15.12",
|
|
42
42
|
"vue": "^2.7.14",
|
|
43
43
|
"vue-router": "^3.5.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@vue/cli-plugin-babel": "~4.5.19",
|
|
47
47
|
"@vue/cli-service": "~4.5.19",
|
|
48
|
-
"axios": "^1.1
|
|
48
|
+
"axios": "^1.2.1",
|
|
49
49
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
50
50
|
"vue-template-compiler": "^2.7.14"
|
|
51
51
|
}
|
package/plugins/request.js
CHANGED
|
@@ -205,6 +205,20 @@ class RequestClass {
|
|
|
205
205
|
return config;
|
|
206
206
|
},
|
|
207
207
|
(error) => {
|
|
208
|
+
let responseData = error.response;
|
|
209
|
+
const responseStatus = responseData.status;
|
|
210
|
+
if (responseStatus == 401 || responseStatus == '401') {
|
|
211
|
+
let errorMsg = (responseData && responseData.data && responseData.data.error) || '用户没有访问权限';
|
|
212
|
+
Message({
|
|
213
|
+
type: 'error',
|
|
214
|
+
showClose: true,
|
|
215
|
+
duration: 1300,
|
|
216
|
+
message: errorMsg
|
|
217
|
+
});
|
|
218
|
+
return Promise.reject(errorMsg);
|
|
219
|
+
}
|
|
220
|
+
if (responseStatus == 500 || responseStatus == '500') {
|
|
221
|
+
}
|
|
208
222
|
// 错误抛到业务代码
|
|
209
223
|
error.data = {};
|
|
210
224
|
error.data.message = '服务器异常,请联系管理员!';
|
|
@@ -271,7 +285,7 @@ class RequestClass {
|
|
|
271
285
|
* @param {Object} options
|
|
272
286
|
* @returns {Class} this
|
|
273
287
|
*/
|
|
274
|
-
|
|
288
|
+
setDefRequests(options = {}) {
|
|
275
289
|
this.requests = Object.assign({}, this.requests, options || {});
|
|
276
290
|
this.reqObj.defaults.requests = this.requests;
|
|
277
291
|
return this;
|