From 5b35c953b1d698b17e6dcaaa50eeb2a06026c1e4 Mon Sep 17 00:00:00 2001 From: K <1175047471@qq.com> Date: Thu, 18 Apr 2024 20:05:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/axios/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index bf24406e..4a74416c 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -230,7 +230,7 @@ const transform: AxiosTransform = { errorLogStore.addAjaxErrorInfo(error) const { response, code, message, config } = error || {} const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none' - const msg: string = response?.data?.msg ?? '' + const msg: string = response?.data?.msg ?? response?.data?.error_description ?? '' const err: string = error?.toString?.() ?? '' let errMessage = '' @@ -266,6 +266,8 @@ const transform: AxiosTransform = { config.method?.toUpperCase() === RequestEnum.GET && isOpenRetry && retryRequest.retry(axiosInstance, error) + + error.message = msg || error.message return Promise.reject(error) }, }