|
@@ -1,6 +1,6 @@
|
|
|
import store from '@/store'
|
|
|
import config from '@/config'
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
+import { getToken,removeToken } from '@/utils/auth'
|
|
|
import errorCode from '@/utils/errorCode'
|
|
|
import { toast, showConfirm, tansParams } from '@/utils/common'
|
|
|
import { RequestConfig, ResponseData } from '@/types/request'
|
|
@@ -42,6 +42,7 @@ const request = <T>(config:RequestConfig):Promise<ResponseData<T>> => {
|
|
|
// @ts-ignore
|
|
|
const msg:string = errorCode[code] || data.msg || errorCode['default']
|
|
|
if (code === 401) {
|
|
|
+ removeToken();
|
|
|
showConfirm('您还未登陆系统,是否前往登陆?').then(res => {
|
|
|
if (res.confirm) {
|
|
|
store.dispatch('LogOut').then(res => {
|