Commit 7684270dedd5803f71a08fe4318a34b0afcd7f54
1 parent
263d95a9
fix:DEFECT-839 设备访问令牌重复后提示undefind
Showing
1 changed file
with
4 additions
and
2 deletions
@@ -118,8 +118,10 @@ const transform: AxiosTransform = { | @@ -118,8 +118,10 @@ const transform: AxiosTransform = { | ||
118 | errorLogStore.addAjaxErrorInfo(error); | 118 | errorLogStore.addAjaxErrorInfo(error); |
119 | const { response, code, message, config } = error || {}; | 119 | const { response, code, message, config } = error || {}; |
120 | const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none'; | 120 | const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none'; |
121 | - // const msg: string = response?.data?.msg ?? ''; | ||
122 | - const msg: string = response?.data?.message || response?.data?.msg; | 121 | + const errorMsgIsObj = typeof response.data === 'object'; |
122 | + const msg: string = errorMsgIsObj | ||
123 | + ? response?.data?.message || response?.data?.msg | ||
124 | + : response.data; | ||
123 | const err: string = error?.toString?.() ?? ''; | 125 | const err: string = error?.toString?.() ?? ''; |
124 | let errMessage = ''; | 126 | let errMessage = ''; |
125 | try { | 127 | try { |