|
|
@@ -1,7 +1,6 @@
|
|
|
-import axios from 'axios';
|
|
|
-import Router from '@/router';
|
|
|
import { getToken } from '@/services/bus/token';
|
|
|
-import APP from '@/services/index';
|
|
|
+import eventBus from '@/utils/eventBus/index';
|
|
|
+import axios from 'axios';
|
|
|
|
|
|
const request = axios.create({
|
|
|
// 配置选项
|
|
|
@@ -39,6 +38,8 @@ request.interceptors.response.use(
|
|
|
console.error(`${data.msg}(${data.code})`);
|
|
|
} else if (status === 401) {
|
|
|
// 主要处理token失效时 页面进行接口请求时的异常情况
|
|
|
+
|
|
|
+ eventBus.$emit('logout');
|
|
|
console.warn('待处理,token失效')
|
|
|
} else if (status === 403) {
|
|
|
console.error(`${data.msg}(${data.code})`);
|