Skip to content

Commit

Permalink
fix(front): 401时只唤起登录弹窗,不弹出nextError消息提示
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 13055
  • Loading branch information
hyunfa authored and wyyalt committed Jul 25, 2024
1 parent 3f496cf commit 0297353
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ function handleReject(error, config) {
if (config.globalError && error.response) {
const { status, data } = error.response;
const nextError = { message: error.message, response: error.response };
// 401时只唤起登录弹窗,不弹出nextError消息提示
if (status === 401) {
// 未登录, o.a 登录弹窗有问题先不做弹窗
let siteLoginUrl = window.PROJECT_CONFIG.LOGIN_URL;
Expand All @@ -207,10 +208,11 @@ function handleReject(error, config) {
showLoginModal({ loginUrl });
} else if (status === 500) {
nextError.message = '系统出现异常';
messageError(nextError.message);
} else if (data && data.message) {
nextError.message = data.message;
messageError(nextError.message);
}
messageError(nextError.message);
console.error(nextError.message);
return Promise.reject(nextError);
}
Expand Down

0 comments on commit 0297353

Please sign in to comment.