From 8a27eb793148aa30558f3efa317fde14b6367dc1 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 17 十月 2025 14:54:13 +0800
Subject: [PATCH] feat: 1.2.0.1
---
src/utils/request/index.ts | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/utils/request/index.ts b/src/utils/request/index.ts
index d12fccc..e11bb12 100644
--- a/src/utils/request/index.ts
+++ b/src/utils/request/index.ts
@@ -120,6 +120,9 @@
const errorInfo: ErrorInfo | undefined = (error as any).info;
if (errorInfo) {
const { errorMessage, errorCode } = errorInfo;
+ if (Number(errorCode) === 401) {
+ handleLogout();
+ }
switch (errorInfo.showType) {
case ErrorShowType.SILENT:
// do nothing
@@ -145,7 +148,7 @@
} else if ((error as AxiosError<ResponseStructure, IRequestOptions>).response) {
// Axios 鐨勯敊璇�
// 璇锋眰鎴愬姛鍙戝嚭涓旀湇鍔″櫒涔熷搷搴斾簡鐘舵�佺爜锛屼絾鐘舵�佷唬鐮佽秴鍑轰簡 2xx 鐨勮寖鍥�
- handleAxiosResponseError(error as AxiosError<ErrorResponse, IRequestOptions>);
+ handleAxiosResponseError(error as AxiosError<ResponseStructure, IRequestOptions>);
// Message.errorMessage(`Response status:${(error as AxiosError).response.status}`);
} else if ((error as AxiosError).request) {
// 璇锋眰宸茬粡鎴愬姛鍙戣捣锛屼絾娌℃湁鏀跺埌鍝嶅簲
--
Gitblit v1.9.1