|
@@ -3,7 +3,12 @@ import store from '../store/index.js'
|
|
|
|
|
|
const install = (Vue, vm) => {
|
|
|
Vue.prototype.$u.http.setConfig({
|
|
|
- baseUrl: config.baseUrl
|
|
|
+ baseUrl: config.baseUrl,
|
|
|
+ showLoading: true,
|
|
|
+ loadingText: '请求中...',
|
|
|
+ loadingTime: 500,
|
|
|
+ originalData: false,
|
|
|
+ loadingMask: true
|
|
|
});
|
|
|
|
|
|
Vue.prototype.$u.http.interceptor.request = (config) => {
|
|
@@ -12,7 +17,7 @@ const install = (Vue, vm) => {
|
|
|
}
|
|
|
|
|
|
config.url = config.url + '?t=' + Date.now()
|
|
|
- let noTokenList = ['/wechat/h5/user','/client/auth/verifyCode'];
|
|
|
+ let noTokenList = ['/client/wechat/h5/code/', '/client/auth/sendSmsCodeV2', '/client/auth/verifyCodeV2'];
|
|
|
if(noTokenList.includes(config.url)) config.header.noToken = true;
|
|
|
return config;
|
|
|
}
|
|
@@ -20,7 +25,7 @@ const install = (Vue, vm) => {
|
|
|
Vue.prototype.$u.http.interceptor.response = (res) => {
|
|
|
if(res.code == 200) {
|
|
|
return res;
|
|
|
- } else if(res.code == 401 || res.code == 400){
|
|
|
+ } else if(res.code == 401 || res.code == 400) {
|
|
|
const backUrl = location.href
|
|
|
|
|
|
const ua = window.navigator.userAgent.toLowerCase();
|