From fe361fdd8698c2da85a64f5c72c40a2ae30815ef Mon Sep 17 00:00:00 2001 From: pengda <1111@qq.com> Date: Wed, 17 Sep 2025 11:02:23 +0800 Subject: [PATCH] =?UTF-8?q?token=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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失效