diff --git a/src/utils/request.js b/src/utils/request.js index d13fa9f..0402f95 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,7 @@ // src/utils/request.js import axios from "axios"; import { handleTokenRefresh } from '@/utils/loginRefresh'; +import { logout } from '@/utils/logout'; // 创建 axios 实例 const service = axios.create({ @@ -55,8 +56,8 @@ service.interceptors.response.use( window.location.href = '/'; break; case 401: - // 未授权,跳转到登录页 - // window.location.href = process.env.VUE_APP_HOST; + // token异常,跳转到登录页 + logout() break; case 402: // token失效