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 | 118 | errorLogStore.addAjaxErrorInfo(error); |
119 | 119 | const { response, code, message, config } = error || {}; |
120 | 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 | 125 | const err: string = error?.toString?.() ?? ''; |
124 | 126 | let errMessage = ''; |
125 | 127 | try { | ... | ... |