Browse Source

fix: 优化errorHandler中对showType进行提示的逻辑

lanjianrong 4 years atrás
parent
commit
05e73e1e64
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/app.tsx

+ 3 - 0
src/app.tsx

@@ -112,9 +112,11 @@ const errorHandler = error => {
         console.log('error', showType === ErrorShowType.ERROR_MESSAGE)
 
         message.error(errorMessage)
+        break
       case ErrorShowType.WARN_MESSAGE:
         console.log('warn', showType === ErrorShowType.WARN_MESSAGE)
         message.warn(errorMessage)
+        break
       case ErrorShowType.NOTIFICATION:
         console.log('noti', showType === ErrorShowType.NOTIFICATION)
         const title = consts.TOKEN_INVALID_CODE.includes(errorCode) ? '用户信息过期' : '请求失败'
@@ -122,6 +124,7 @@ const errorHandler = error => {
           message: title,
           description: errorMessage
         })
+        break
       default:
         break
     }