fix: 更改接口状态判断方式
This commit is contained in:
@@ -4,6 +4,7 @@ import '@/assets/css/font/iconfont.js'
|
||||
import router from '@/router'
|
||||
import store from '@/store'
|
||||
import App from '@/App.vue'
|
||||
import '@/utils/http.js'
|
||||
import { hasPermission } from '@/permission'
|
||||
import commonMixin from '@/mixins/common'
|
||||
import { cancelWithChange, noData } from '@/utils/tools'
|
||||
|
||||
@@ -6,7 +6,6 @@ const CancelToken = axios.CancelToken
|
||||
|
||||
axios.interceptors.request.use(config => {
|
||||
const token = localStorage.getItem(storageKey.token)
|
||||
|
||||
// 添加http请求终止方法
|
||||
const arr = []
|
||||
const cancelToken = new CancelToken(function executor (c) {
|
||||
@@ -63,11 +62,9 @@ axios.interceptors.response.use(
|
||||
if (licenceErrorCode.indexOf(response.data.code) !== -1) {
|
||||
localStorage.removeItem(storageKey.token)
|
||||
window.location.href = '/'
|
||||
} else if (response.status === 200) {
|
||||
if (accountErrorCode.indexOf(response.data.code) !== -1) {
|
||||
localStorage.removeItem(storageKey.token)
|
||||
window.location.href = '/'
|
||||
}
|
||||
} else if (accountErrorCode.indexOf(response.data.code) !== -1) {
|
||||
localStorage.removeItem(storageKey.token)
|
||||
window.location.href = '/'
|
||||
}
|
||||
return response
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user