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);