From 8bac9451060fcddf48048bcef8ff74472798c466 Mon Sep 17 00:00:00 2001 From: cr <423803750@qq.com> Date: Sat, 25 Apr 2026 13:40:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/hooks/useModal.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sheep/hooks/useModal.js b/sheep/hooks/useModal.js index c8e9aac..13d0d12 100644 --- a/sheep/hooks/useModal.js +++ b/sheep/hooks/useModal.js @@ -5,11 +5,24 @@ import { ref } from 'vue'; import test from '@/sheep/helper/test.js'; import AuthUtil from '@/sheep/api/member/auth'; +// 防止重复跳转登录页 +let isNavigatingToLogin = false; + // 打开授权弹框 - 改为页面跳转 export function showAuthModal(type = 'smsLogin') { + // 正在跳转中,直接返回,防止重复跳转 + if (isNavigatingToLogin) return; + isNavigatingToLogin = true; + // 跳转到登录页面,传递登录类型 uni.navigateTo({ url: `/pages/index/login-page?type=${type}`, + complete: () => { + // 延时重置标志位,避免短时间内连续触发 + setTimeout(() => { + isNavigatingToLogin = false; + }, 800); + }, fail: () => { // 如果跳转失败,降级使用弹窗方式 const modal = $store('modal');