byt-ui 0.1.9 → 0.1.10
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/byt-ui.common.js +24 -19
- package/lib/byt-ui.umd.js +24 -19
- package/lib/byt-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/common/modules/request.js +19 -13
package/lib/byt-ui.common.js
CHANGED
|
@@ -176225,8 +176225,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
176225
176225
|
|
|
176226
176226
|
// EXPORTS
|
|
176227
176227
|
__webpack_require__.d(__webpack_exports__, {
|
|
176228
|
-
"default": function() { return /* binding */
|
|
176229
|
-
|
|
176228
|
+
"default": function() { return /* binding */ request; },
|
|
176229
|
+
fetch: function() { return /* binding */ request_fetch; }
|
|
176230
176230
|
});
|
|
176231
176231
|
|
|
176232
176232
|
// NAMESPACE OBJECT: ./node_modules/axios/lib/platform/common/utils.js
|
|
@@ -180165,12 +180165,12 @@ var cookie = __webpack_require__(71099);
|
|
|
180165
180165
|
|
|
180166
180166
|
|
|
180167
180167
|
class request_Request {
|
|
180168
|
-
constructor(config = {}) {
|
|
180168
|
+
constructor(config = {}, Vue = null) {
|
|
180169
180169
|
const {
|
|
180170
180170
|
options = {},
|
|
180171
180171
|
handler = {}
|
|
180172
180172
|
} = config;
|
|
180173
|
-
this.
|
|
180173
|
+
this._Vue = Vue || null;
|
|
180174
180174
|
this._errorCode = {
|
|
180175
180175
|
'000': '操作太频繁,请勿重复请求',
|
|
180176
180176
|
'401': '当前操作没有权限',
|
|
@@ -180178,8 +180178,9 @@ class request_Request {
|
|
|
180178
180178
|
'404': '接口不存在',
|
|
180179
180179
|
'417': '未绑定登录账号,请使用密码登录后绑定',
|
|
180180
180180
|
'423': '演示环境不能操作,如需了解联系我们',
|
|
180181
|
+
'424': 'token过期,请重新登录',
|
|
180181
180182
|
'426': '用户名不存在或密码错误',
|
|
180182
|
-
'428': '
|
|
180183
|
+
'428': 'token过期,请重新登录',
|
|
180183
180184
|
'429': '请求过频繁',
|
|
180184
180185
|
'479': '演示环境,没有权限操作',
|
|
180185
180186
|
'default': '系统未知错误,请反馈给管理员'
|
|
@@ -180192,6 +180193,7 @@ class request_Request {
|
|
|
180192
180193
|
timeout: 60000,
|
|
180193
180194
|
withCredentials: false
|
|
180194
180195
|
}, options);
|
|
180196
|
+
this.request = lib_axios.create(this.options);
|
|
180195
180197
|
// 注册fetch;
|
|
180196
180198
|
this.register();
|
|
180197
180199
|
}
|
|
@@ -180220,7 +180222,6 @@ class request_Request {
|
|
|
180220
180222
|
case 200:
|
|
180221
180223
|
if (res.data.code === 1) {
|
|
180222
180224
|
element_ui_common.Message.error(message);
|
|
180223
|
-
this.handler.error && this.handler.error(res.data);
|
|
180224
180225
|
return Promise.reject(res.data);
|
|
180225
180226
|
}
|
|
180226
180227
|
this.handler.success && this.handler.success(res.data);
|
|
@@ -180229,10 +180230,16 @@ class request_Request {
|
|
|
180229
180230
|
case 428:
|
|
180230
180231
|
// 后台定义 424||428 针对令牌过期的特殊响应码
|
|
180231
180232
|
this.handler.expire && this.handler.expire(res.data);
|
|
180233
|
+
element_ui_common.Message.error(message);
|
|
180234
|
+
if (window.__POWERED_BY_QIANKUN__ && this._Vue) {
|
|
180235
|
+
const {
|
|
180236
|
+
outLogin
|
|
180237
|
+
} = this._Vue.prototype.$appCommon;
|
|
180238
|
+
outLogin && outLogin();
|
|
180239
|
+
}
|
|
180232
180240
|
break;
|
|
180233
180241
|
default:
|
|
180234
180242
|
element_ui_common.Message.error(message);
|
|
180235
|
-
this.handler.error && this.handler.error(res.data);
|
|
180236
180243
|
return Promise.reject(message);
|
|
180237
180244
|
}
|
|
180238
180245
|
}, error => {
|
|
@@ -180246,7 +180253,7 @@ class request_Request {
|
|
|
180246
180253
|
element_ui_common.Message.error(error.response.data.msg);
|
|
180247
180254
|
break;
|
|
180248
180255
|
}
|
|
180249
|
-
this.error && this.error(error.response);
|
|
180256
|
+
this.handler.error && this.handler.error(error.response);
|
|
180250
180257
|
}
|
|
180251
180258
|
return Promise.reject(new Error(error));
|
|
180252
180259
|
});
|
|
@@ -180295,8 +180302,6 @@ class request_Request {
|
|
|
180295
180302
|
});
|
|
180296
180303
|
}
|
|
180297
180304
|
register() {
|
|
180298
|
-
this.request = lib_axios.create(this.options);
|
|
180299
|
-
|
|
180300
180305
|
// 添加拦截器
|
|
180301
180306
|
this.interceptors();
|
|
180302
180307
|
|
|
@@ -180304,15 +180309,15 @@ class request_Request {
|
|
|
180304
180309
|
this.setMethods();
|
|
180305
180310
|
}
|
|
180306
180311
|
}
|
|
180307
|
-
const {
|
|
180308
|
-
|
|
180309
|
-
|
|
180310
|
-
|
|
180311
|
-
|
|
180312
|
-
|
|
180313
|
-
|
|
180314
|
-
|
|
180315
|
-
Vue.prototype.$http =
|
|
180312
|
+
const request_fetch = (config = {}, Vue) => {
|
|
180313
|
+
const {
|
|
180314
|
+
request
|
|
180315
|
+
} = new request_Request(Object.assign({}, config), Vue);
|
|
180316
|
+
return request;
|
|
180317
|
+
};
|
|
180318
|
+
/* harmony default export */ var request = ({
|
|
180319
|
+
install(Vue, config = {}) {
|
|
180320
|
+
Vue.prototype.$http = request_fetch(config, Vue);
|
|
180316
180321
|
}
|
|
180317
180322
|
});
|
|
180318
180323
|
|
package/lib/byt-ui.umd.js
CHANGED
|
@@ -176235,8 +176235,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
176235
176235
|
|
|
176236
176236
|
// EXPORTS
|
|
176237
176237
|
__webpack_require__.d(__webpack_exports__, {
|
|
176238
|
-
"default": function() { return /* binding */
|
|
176239
|
-
|
|
176238
|
+
"default": function() { return /* binding */ request; },
|
|
176239
|
+
fetch: function() { return /* binding */ request_fetch; }
|
|
176240
176240
|
});
|
|
176241
176241
|
|
|
176242
176242
|
// NAMESPACE OBJECT: ./node_modules/axios/lib/platform/common/utils.js
|
|
@@ -180175,12 +180175,12 @@ var cookie = __webpack_require__(41591);
|
|
|
180175
180175
|
|
|
180176
180176
|
|
|
180177
180177
|
class request_Request {
|
|
180178
|
-
constructor(config = {}) {
|
|
180178
|
+
constructor(config = {}, Vue = null) {
|
|
180179
180179
|
const {
|
|
180180
180180
|
options = {},
|
|
180181
180181
|
handler = {}
|
|
180182
180182
|
} = config;
|
|
180183
|
-
this.
|
|
180183
|
+
this._Vue = Vue || null;
|
|
180184
180184
|
this._errorCode = {
|
|
180185
180185
|
'000': '操作太频繁,请勿重复请求',
|
|
180186
180186
|
'401': '当前操作没有权限',
|
|
@@ -180188,8 +180188,9 @@ class request_Request {
|
|
|
180188
180188
|
'404': '接口不存在',
|
|
180189
180189
|
'417': '未绑定登录账号,请使用密码登录后绑定',
|
|
180190
180190
|
'423': '演示环境不能操作,如需了解联系我们',
|
|
180191
|
+
'424': 'token过期,请重新登录',
|
|
180191
180192
|
'426': '用户名不存在或密码错误',
|
|
180192
|
-
'428': '
|
|
180193
|
+
'428': 'token过期,请重新登录',
|
|
180193
180194
|
'429': '请求过频繁',
|
|
180194
180195
|
'479': '演示环境,没有权限操作',
|
|
180195
180196
|
'default': '系统未知错误,请反馈给管理员'
|
|
@@ -180202,6 +180203,7 @@ class request_Request {
|
|
|
180202
180203
|
timeout: 60000,
|
|
180203
180204
|
withCredentials: false
|
|
180204
180205
|
}, options);
|
|
180206
|
+
this.request = lib_axios.create(this.options);
|
|
180205
180207
|
// 注册fetch;
|
|
180206
180208
|
this.register();
|
|
180207
180209
|
}
|
|
@@ -180230,7 +180232,6 @@ class request_Request {
|
|
|
180230
180232
|
case 200:
|
|
180231
180233
|
if (res.data.code === 1) {
|
|
180232
180234
|
element_ui_common.Message.error(message);
|
|
180233
|
-
this.handler.error && this.handler.error(res.data);
|
|
180234
180235
|
return Promise.reject(res.data);
|
|
180235
180236
|
}
|
|
180236
180237
|
this.handler.success && this.handler.success(res.data);
|
|
@@ -180239,10 +180240,16 @@ class request_Request {
|
|
|
180239
180240
|
case 428:
|
|
180240
180241
|
// 后台定义 424||428 针对令牌过期的特殊响应码
|
|
180241
180242
|
this.handler.expire && this.handler.expire(res.data);
|
|
180243
|
+
element_ui_common.Message.error(message);
|
|
180244
|
+
if (window.__POWERED_BY_QIANKUN__ && this._Vue) {
|
|
180245
|
+
const {
|
|
180246
|
+
outLogin
|
|
180247
|
+
} = this._Vue.prototype.$appCommon;
|
|
180248
|
+
outLogin && outLogin();
|
|
180249
|
+
}
|
|
180242
180250
|
break;
|
|
180243
180251
|
default:
|
|
180244
180252
|
element_ui_common.Message.error(message);
|
|
180245
|
-
this.handler.error && this.handler.error(res.data);
|
|
180246
180253
|
return Promise.reject(message);
|
|
180247
180254
|
}
|
|
180248
180255
|
}, error => {
|
|
@@ -180256,7 +180263,7 @@ class request_Request {
|
|
|
180256
180263
|
element_ui_common.Message.error(error.response.data.msg);
|
|
180257
180264
|
break;
|
|
180258
180265
|
}
|
|
180259
|
-
this.error && this.error(error.response);
|
|
180266
|
+
this.handler.error && this.handler.error(error.response);
|
|
180260
180267
|
}
|
|
180261
180268
|
return Promise.reject(new Error(error));
|
|
180262
180269
|
});
|
|
@@ -180305,8 +180312,6 @@ class request_Request {
|
|
|
180305
180312
|
});
|
|
180306
180313
|
}
|
|
180307
180314
|
register() {
|
|
180308
|
-
this.request = lib_axios.create(this.options);
|
|
180309
|
-
|
|
180310
180315
|
// 添加拦截器
|
|
180311
180316
|
this.interceptors();
|
|
180312
180317
|
|
|
@@ -180314,15 +180319,15 @@ class request_Request {
|
|
|
180314
180319
|
this.setMethods();
|
|
180315
180320
|
}
|
|
180316
180321
|
}
|
|
180317
|
-
const {
|
|
180318
|
-
|
|
180319
|
-
|
|
180320
|
-
|
|
180321
|
-
|
|
180322
|
-
|
|
180323
|
-
|
|
180324
|
-
|
|
180325
|
-
Vue.prototype.$http =
|
|
180322
|
+
const request_fetch = (config = {}, Vue) => {
|
|
180323
|
+
const {
|
|
180324
|
+
request
|
|
180325
|
+
} = new request_Request(Object.assign({}, config), Vue);
|
|
180326
|
+
return request;
|
|
180327
|
+
};
|
|
180328
|
+
/* harmony default export */ var request = ({
|
|
180329
|
+
install(Vue, config = {}) {
|
|
180330
|
+
Vue.prototype.$http = request_fetch(config, Vue);
|
|
180326
180331
|
}
|
|
180327
180332
|
});
|
|
180328
180333
|
|