|
|
@@ -1,5 +1,5 @@
|
|
|
import axios from 'axios'
|
|
|
-import history from './history'
|
|
|
+import { loginOutFu } from './history'
|
|
|
import { getTokenInfo, removeTokenInfo } from './storage'
|
|
|
import store from '@/store'
|
|
|
import { MessageFu } from './message'
|
|
|
@@ -61,10 +61,10 @@ http.interceptors.response.use(
|
|
|
}
|
|
|
if (response.data.code === 401) {
|
|
|
removeTokenInfo()
|
|
|
- history.push('/login')
|
|
|
+ loginOutFu()
|
|
|
clearTimeout(timeId)
|
|
|
timeId = window.setTimeout(() => {
|
|
|
- MessageFu.warning('登录失效!')
|
|
|
+ MessageFu.warning('登录超时!')
|
|
|
}, 200)
|
|
|
} else if (response.data.code === 0) {
|
|
|
// MessageFu.success(response.data.msg);
|
|
|
@@ -92,7 +92,7 @@ http.interceptors.response.use(
|
|
|
// 没有权限
|
|
|
if (err.response.data.code === 401) {
|
|
|
removeTokenInfo()
|
|
|
- history.push('/login')
|
|
|
+ loginOutFu()
|
|
|
}
|
|
|
} else MessageFu.error('响应错误,请联系管理员!')
|
|
|
}
|