diff --git a/pages/login/login.vue b/pages/login/login.vue index 32001df..35f3c29 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -535,26 +535,21 @@ }); return; } - console.log(12) // 2. 防止重复点击(倒计时中) if (this.smsCountdown > 0) { return; } - console.log(34) // 3. 调用发送接口 uni.showLoading({ title: '发送中...' }); try { - console.log(56) const { data: res } = await uni.$http.post('/sms/sendCode', { phone: phone }); - console.log(78) uni.hideLoading(); - console.log(9) if (res && res.code === 200) { this.$refs.uToast.show({ title: '验证码已发送', @@ -563,6 +558,15 @@ }); // 开始倒计时 this.startCountdown(); + } else if (res && res.code === 201) { + this.$refs.uToast.show({ + title: '验证码已发送', + type: 'success', + duration: 2000 + }); + // 开始倒计时 + this.startCountdown(); + this.form.smsCode=res.data } else { this.$refs.uToast.show({ title: res.msg || '发送失败,请重试',