|
@@ -1,4 +1,5 @@
|
|
|
import axios from 'axios'
|
|
|
+import router from "@/router";
|
|
|
import {Notification, MessageBox, Message, Loading} from 'element-ui'
|
|
|
import {removeAll, getToken} from '@/utils/auth'
|
|
|
import errorCode from '@/utils/errorCode'
|
|
@@ -95,9 +96,12 @@ service.interceptors.response.use(res => {
|
|
|
isRelogin.show = false
|
|
|
logout().then(res => {
|
|
|
removeAll()
|
|
|
- location.href = '/index'
|
|
|
+ // location.href = '/index'
|
|
|
+ router.push({path: '/', query: {}})
|
|
|
+ window.location.reload()
|
|
|
});
|
|
|
})
|
|
|
+ return
|
|
|
}
|
|
|
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
|
|
} else if (code === 403) {
|
|
@@ -108,8 +112,11 @@ service.interceptors.response.use(res => {
|
|
|
}).then(r => {
|
|
|
isRelogin.show = false
|
|
|
removeAll()
|
|
|
- location.href = '/index'
|
|
|
+ router.push({path: '/', query: {}})
|
|
|
+ window.location.reload()
|
|
|
+ // location.href = '/index'
|
|
|
})
|
|
|
+ return
|
|
|
}
|
|
|
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
|
|
} else if (code === 500) {
|