Xiao_123 1 rok pred
rodič
commit
46bf9abd5d

+ 6 - 1
sheep/components/s-auth-modal/components/change-mobile.vue

@@ -30,7 +30,7 @@
               class="ss-reset-button code-btn-start"
               :disabled="state.isMobileEnd"
               :class="{ 'code-btn-end': state.isMobileEnd }"
-              @tap="getSmsCode('changeMobile', state.model.mobile)"
+              @tap="handleSendCode"
             >
               {{ getSmsTimer('changeMobile') }}
             </button>
@@ -90,6 +90,11 @@
     },
   });
 
+  const handleSendCode = () => {
+    if (!state.model.mobile) return sheep.$helper.toast('请输入手机号');
+    getSmsCode('changeMobile', state.model.mobile)
+  }
+
   // 绑定手机号
   async function changeMobileSubmit() {
     const validate = await unref(changeMobileRef)

+ 6 - 1
sheep/components/s-auth-modal/components/change-password.vue

@@ -29,7 +29,7 @@
               class="ss-reset-button code-btn code-btn-start"
               :disabled="state.isMobileEnd"
               :class="{ 'code-btn-end': state.isMobileEnd }"
-              @tap="getSmsCode('changePassword')"
+              @tap="handleSendCode"
             >
               {{ getSmsTimer('resetPassword') }}
             </button>
@@ -80,6 +80,11 @@
     },
   });
 
+  const handleSendCode = () => {
+    if (!state.model.mobile) return sheep.$helper.toast('请输入手机号');
+    getSmsCode('changePassword')
+  }
+
   // 更改密码
   async function changePasswordSubmit() {
     // 参数校验

+ 6 - 1
sheep/components/s-auth-modal/components/reset-password.vue

@@ -28,7 +28,7 @@
               class="ss-reset-button code-btn code-btn-start"
               :disabled="state.isMobileEnd"
               :class="{ 'code-btn-end': state.isMobileEnd }"
-              @tap="getSmsCode('resetPassword', state.model.mobile)"
+              @tap="handleSendCode"
             >
               {{ getSmsTimer('resetPassword') }}
             </button>
@@ -93,6 +93,11 @@
     },
   });
 
+  const handleSendCode = () => {
+    if (!state.model.mobile) return sheep.$helper.toast('请输入手机号');
+    getSmsCode('resetPassword', state.model.mobile)
+  }
+
   // 重置密码
   const resetPasswordSubmit = async () => {
     // 参数校验