Commit 69c19020 authored by 李纪文's avatar 李纪文

feat: 去除错误拦截

parent 17ef21f7
......@@ -37,27 +37,27 @@ instanceRequest.setErrorHandler((error) => {
const { status, config } = response;
if (status === 401) {
if (!instance) {
instance = warning({
title: '错误信息',
content: `${codeMessage[status]}`,
centered: true,
onOk(close) {
window.share && window.share.event && window.share.event.emit('triggerLoginout');
close();
},
});
// instance = warning({
// title: '错误信息',
// content: `${codeMessage[status]}`,
// centered: true,
// onOk(close) {
// window.share && window.share.event && window.share.event.emit('triggerLoginout');
// close();
// },
// });
}
} else {
notification.error({
message: `请求错误 ${status}: ${config.url}`,
description: errorText,
});
// notification.error({
// message: `请求错误 ${status}: ${config.url}`,
// description: errorText,
// });
}
} else if (!response) {
notification.error({
description: '您的网络发生异常,无法连接服务器',
message: '网络异常',
});
// notification.error({
// description: '您的网络发生异常,无法连接服务器',
// message: '网络异常',
// });
}
return response;
});
......
......@@ -34,27 +34,27 @@ instanceRequest.setErrorHandler((error) => {
const { status, config } = response;
if (status === 401) {
if (!instance) {
instance = warning({
title: '错误信息',
content: `${codeMessage[status]}`,
centered: true,
onOk(close) {
window.share && window.share.event && window.share.event.emit('triggerLoginout');
close();
},
});
// instance = warning({
// title: '错误信息',
// content: `${codeMessage[status]}`,
// centered: true,
// onOk(close) {
// window.share && window.share.event && window.share.event.emit('triggerLoginout');
// close();
// },
// });
}
} else {
notification.error({
message: `请求错误 ${status}: ${config.url}`,
description: errorText,
});
// notification.error({
// message: `请求错误 ${status}: ${config.url}`,
// description: errorText,
// });
}
} else if (!response) {
notification.error({
description: '您的网络发生异常,无法连接服务器',
message: '网络异常',
});
// notification.error({
// description: '您的网络发生异常,无法连接服务器',
// message: '网络异常',
// });
}
return response;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment