|
@@ -1,9 +1,10 @@
|
|
|
import axios from 'axios'
|
|
|
import store from './store'
|
|
|
+import { Message } from 'element-ui'
|
|
|
// export const BASE_URL = 'https://api.xyyxt.net' //release
|
|
|
// export const BASE_URL = 'http://42.192.164.187:19005' //test
|
|
|
-export const BASE_URL = 'https://test.xyyxt.net' //预发布
|
|
|
-// export const BASE_URL = 'http://192.168.1.24:5055' //dev
|
|
|
+// export const BASE_URL = 'https://test.xyyxt.net' //预发布
|
|
|
+export const BASE_URL = 'http://192.168.1.24:5055' //dev
|
|
|
// export const BASE_URL = 'http://120.79.166.78:19012' //测试-外网
|
|
|
export const tenantId = '867735392558919680'
|
|
|
|
|
@@ -43,7 +44,7 @@ request.interceptors.request.use(config => {
|
|
|
config.headers['AuthorizationToken'] = 'WX ' + token // 让每个请求携带自定义 token 请根据实际情况自行修改
|
|
|
}
|
|
|
config.headers['TenantId'] = tenantId
|
|
|
-
|
|
|
+
|
|
|
return config
|
|
|
}, err)
|
|
|
|
|
@@ -63,15 +64,15 @@ request.interceptors.response.use(async (response) => {
|
|
|
// });
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
- console.log('1231231')
|
|
|
- store.commit('setCurrentRouter',router.currentRoute)
|
|
|
- localStorage.removeItem('user_account')
|
|
|
- localStorage.removeItem('token')
|
|
|
- router.push({
|
|
|
- path: '/login'
|
|
|
- })
|
|
|
-
|
|
|
- return Promise.reject(res)
|
|
|
+ console.log('1231231')
|
|
|
+ store.commit('setCurrentRouter', router.currentRoute)
|
|
|
+ localStorage.removeItem('user_account')
|
|
|
+ localStorage.removeItem('token')
|
|
|
+ router.push({
|
|
|
+ path: '/login'
|
|
|
+ })
|
|
|
+
|
|
|
+ return Promise.reject(res)
|
|
|
// }, 1000);
|
|
|
} else {
|
|
|
let res = await refreshToken(response.config)
|
|
@@ -129,14 +130,14 @@ async function refreshToken(response) {
|
|
|
// });
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
-
|
|
|
- localStorage.removeItem('user_account')
|
|
|
- localStorage.removeItem('token')
|
|
|
- console.log('33333')
|
|
|
- store.commit('setCurrentRouter',router.currentRoute)
|
|
|
- router.push({
|
|
|
- path: '/login'
|
|
|
- })
|
|
|
+
|
|
|
+ localStorage.removeItem('user_account')
|
|
|
+ localStorage.removeItem('token')
|
|
|
+ console.log('33333')
|
|
|
+ store.commit('setCurrentRouter', router.currentRoute)
|
|
|
+ router.push({
|
|
|
+ path: '/login'
|
|
|
+ })
|
|
|
// }, 1000);
|
|
|
}
|
|
|
}
|