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) }, }