yuanmingze 3 bulan lalu
induk
melakukan
2ab4dd313f
1 mengubah file dengan 3 tambahan dan 5 penghapusan
  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