瀏覽代碼

bug修复

yuanmingze 3 月之前
父節點
當前提交
2ab4dd313f
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      src/views/login/index.vue

+ 3 - 5
src/views/login/index.vue

@@ -148,7 +148,7 @@ const sendCode = async () => {
     return
   }
   sending.value = true
-  const toast = showLoadingToast({ message: '发送中…', forbidClick: true, duration: 0 })
+  const toast = showLoadingToast({ message: '发送中…', forbidClick: true, duration: 3000 })
   sendEtsSms.mobile = formData.mobile
   try {
     const res = await sendEtsSmsApi(sendEtsSms)
@@ -159,11 +159,10 @@ const sendCode = async () => {
       codeMessage.value = res.msg
       showDialog.value = true
     }
+    toast.close()
   } catch (err: any) {
-    showFailToast(err?.message || '获取验证码失败')
-  } finally {
     toast.close()
-    sending.value = false
+    showFailToast(err?.message || '获取验证码失败')
   }
 }
 
@@ -236,7 +235,6 @@ const loginBtn = useDebounceFn(async () => {
           })
         }
       }
-
       router.replace({ path: '/invoice-information' })
     } else if (res.code == 401) {
       loginMessage.value = res.msg