fix:登录
parent
d31e99fba0
commit
8bac945106
|
|
@ -5,11 +5,24 @@ import { ref } from 'vue';
|
||||||
import test from '@/sheep/helper/test.js';
|
import test from '@/sheep/helper/test.js';
|
||||||
import AuthUtil from '@/sheep/api/member/auth';
|
import AuthUtil from '@/sheep/api/member/auth';
|
||||||
|
|
||||||
|
// 防止重复跳转登录页
|
||||||
|
let isNavigatingToLogin = false;
|
||||||
|
|
||||||
// 打开授权弹框 - 改为页面跳转
|
// 打开授权弹框 - 改为页面跳转
|
||||||
export function showAuthModal(type = 'smsLogin') {
|
export function showAuthModal(type = 'smsLogin') {
|
||||||
|
// 正在跳转中,直接返回,防止重复跳转
|
||||||
|
if (isNavigatingToLogin) return;
|
||||||
|
isNavigatingToLogin = true;
|
||||||
|
|
||||||
// 跳转到登录页面,传递登录类型
|
// 跳转到登录页面,传递登录类型
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/index/login-page?type=${type}`,
|
url: `/pages/index/login-page?type=${type}`,
|
||||||
|
complete: () => {
|
||||||
|
// 延时重置标志位,避免短时间内连续触发
|
||||||
|
setTimeout(() => {
|
||||||
|
isNavigatingToLogin = false;
|
||||||
|
}, 800);
|
||||||
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
// 如果跳转失败,降级使用弹窗方式
|
// 如果跳转失败,降级使用弹窗方式
|
||||||
const modal = $store('modal');
|
const modal = $store('modal');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue