From 5b5885c8198737164a4c1aa8a652b5da1886519b Mon Sep 17 00:00:00 2001 From: zpc Date: Thu, 24 Apr 2025 01:58:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/user/login.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pages/user/login.vue b/pages/user/login.vue index 0876a80..d05da4f 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -193,14 +193,14 @@ export default { if (res.status == 1) { uni.showToast({ title: '验证码已发送', - icon: 'success' + icon: 'none' }); // 标记已发送验证码(仅当前会话有效) this.codeSent = true; - // 开始倒计时 - this.countdown = 60; + // 开始倒计时,使用接口返回的时间 + this.countdown = res.data || 60; // 使用返回的秒数,默认60秒 this.timer = setInterval(() => { this.countdown--; if (this.countdown <= 0) { @@ -326,13 +326,10 @@ export default { // 重定向到指定URL setTimeout(() => { - that.$customRouter.routerTo({ - url: redirectUrl, - type: 'navigateTo' - }).catch(err => { + that.$customRouter.navigateTo(redirectUrl).catch(err => { console.error('重定向跳转失败:', err) // 失败时跳转到首页 - that.$customRouter.navigateTo('/pages/user/index', {}, 'navigateTo') + that.$customRouter.navigateTo('/pages/user/index') }) }, 1000);