|
@@ -3,7 +3,9 @@ const install = (Vue, vm) => {
|
|
Vue.prototype.$u.http.setConfig({
|
|
Vue.prototype.$u.http.setConfig({
|
|
baseUrl: vm.config.baseUrl,
|
|
baseUrl: vm.config.baseUrl,
|
|
loadingText: '努力加载中~',
|
|
loadingText: '努力加载中~',
|
|
- loadingTime: 800
|
|
+ loadingTime: 800,
|
|
|
|
+ originalData: true,
|
|
|
|
+ dataType: 'text'
|
|
});
|
|
});
|
|
|
|
|
|
Vue.prototype.$u.http.interceptor.request = (config) => {
|
|
Vue.prototype.$u.http.interceptor.request = (config) => {
|
|
@@ -25,9 +27,12 @@ const install = (Vue, vm) => {
|
|
};
|
|
};
|
|
|
|
|
|
Vue.prototype.$u.http.interceptor.response = (res) => {
|
|
Vue.prototype.$u.http.interceptor.response = (res) => {
|
|
|
|
+
|
|
|
|
+ const jsonBigint = require('json-bigint')({ storeAsString: true });
|
|
|
|
+ res = jsonBigint.parse(res.data);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
return res;
|
|
return res;
|
|
- } else if (res.code == 401 || (res.code == 400 && res.msg == '令牌不能为空') ) {
|
|
+ } else if (res.code == 401 || (res.code == 400 && res.msg == '令牌不能为空')) {
|
|
const backUrl = location.href,
|
|
const backUrl = location.href,
|
|
openidPage = vm.config.onlyWxLogin,
|
|
openidPage = vm.config.onlyWxLogin,
|
|
needValidPage = openidPage.filter((item) => backUrl.indexOf(item) > -1);
|
|
needValidPage = openidPage.filter((item) => backUrl.indexOf(item) > -1);
|