You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
// src/utils/http/axios/index.ts
/**
*/
responseInterceptorsCatch: (error: any) => {
...
try {
if (code === 'ECONNABORTED' && message.indexOf('timeout') !== -1) {
errMessage = t('sys.api.apiTimeoutMessage');
}
if (err?.includes('Network Error')) {
errMessage = t('sys.api.networkExceptionMsg');
}
console.log('errMessage', errMessage);
console.log('errorMessageMode', errorMessageMode);
if (errMessage) {
// createErrorModal({ title: t('sys.api.errorTip'), content: errMessage });
// if (errorMessageMode === 'modal') {
// createErrorModal({ title: t('sys.api.errorTip'), content: errMessage });
// } else if (errorMessageMode === 'message') {
// createMessage.error(errMessage);
// }
return Promise.reject(error);
}
} catch (error) {
throw new Error(error);
}
当errMessage有值时, 即使注释掉根据errMessageMode显示不同的消息样式这几段代码,
也一样会显示默认的消息提示。
而如果根据errMessageMode显示不同的消息提示, 默认的消息提示并未被替换掉,而是会出现两个弹框提示
Beta Was this translation helpful? Give feedback.
All reactions