Browse Source

登录报错修改

duy 1 year ago
parent
commit
fedc8782c5
2 changed files with 8 additions and 1 deletions
  1. 2 0
      src/store/modules/user.js
  2. 6 1
      src/views/login/index.vue

+ 2 - 0
src/store/modules/user.js

@@ -27,6 +27,8 @@ export const useAppLogin = async (form) => {
     } else if (status === 401) {
         const info = await setUserAppInfo(res)
         return { error: info.error, msg: info.msg, status:status }
+    } else if (status === 400) {
+        return { error: res.error, msg: res.msg, status:status }
     } else {
         return Promise.reject({ error, status, res })
     

+ 6 - 1
src/views/login/index.vue

@@ -156,11 +156,16 @@ const formValidateClick = async () => {
     }
 
     //登录失败
-    if (error) {
+    if (error && status !== 400) {
         loading.value = false
         window?.$message?.error(msg)
         return false
     }
+    if (error && status === 400) {
+        loading.value = false
+        // window?.$message?.error(msg)
+        return false
+    }
     //登录成功
     loading.value = false
     window?.$message?.success('登录成功')