Skip to content

Commit

Permalink
fix(projects): 修复网络请求错误空信息的提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Soybean committed Nov 30, 2021
1 parent 225c4fe commit ff9216b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/service/msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export function showErrorMsg(error: RequestServiceError) {
if (!NO_ERROR_MSG_CODE.includes(error.code)) {
if (!hasErrorMsg(error)) {
addErrorMsg(error);
window.$message?.error(error.msg, { duration: ERROR_MSG_DURATION });
if (error.msg) {
window.$message?.error(error.msg, { duration: ERROR_MSG_DURATION });
}
setTimeout(() => {
removeErrorMsg(error);
}, ERROR_MSG_DURATION);
Expand Down

0 comments on commit ff9216b

Please sign in to comment.