From 3a5d1a5757c0a2be17e6dd370cbb023ddbb30d5e Mon Sep 17 00:00:00 2001 From: 无木 <netfan@foxmail.com> Date: 星期五, 20 八月 2021 16:55:42 +0800 Subject: [PATCH] fix: refresh failed while token invalid --- src/utils/http/axios/checkStatus.ts | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/http/axios/checkStatus.ts b/src/utils/http/axios/checkStatus.ts index 1c132ee..68c2ecf 100644 --- a/src/utils/http/axios/checkStatus.ts +++ b/src/utils/http/axios/checkStatus.ts @@ -28,9 +28,9 @@ // Jump to the login page if not logged in, and carry the path of the current page // Return to the current page after successful login. This step needs to be operated on the login page. case 401: - errMessage = t('sys.api.errMsg401'); + userStore.setToken(undefined); + errMessage = msg || t('sys.api.errMsg401'); if (stp === SessionTimeoutProcessingEnum.PAGE_COVERAGE) { - userStore.setToken(undefined); userStore.setSessionTimeout(true); } else { userStore.logout(true); -- Gitblit v1.8.0