From 6aef7b85c42834fe0552d549b4304bde6c171b92 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Wed, 3 Sep 2025 15:32:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(router):=20=E5=9C=A8=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E4=B8=AD=E4=BD=BF=E7=94=A8=E5=BE=AE=E4=BF=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E8=B7=B3=E8=BF=87=E6=8B=A6=E6=88=AA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当在小程序环境中配置使用微信登录时,避免执行后续的拦截检查逻辑 --- src/router/interceptor.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index f924068..1daf783 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -6,7 +6,7 @@ import { useTokenStore } from '@/store/token' import { isPageTabbar, tabbarStore } from '@/tabbar/store' import { getAllPages, getLastPage, HOME_PAGE, parseUrlToObj } from '@/utils/index' -import { EXCLUDE_LOGIN_PATH_LIST, isNeedLoginMode, LOGIN_PAGE } from './config' +import { EXCLUDE_LOGIN_PATH_LIST, IS_USE_WX_LOGIN_IN_MP, isNeedLoginMode, LOGIN_PAGE } from './config' export const FG_LOG_ENABLE = false export function judgeIsExcludePath(path: string) { @@ -45,6 +45,11 @@ export const navigateToInterceptor = { // 处理直接进入路由非首页时,tabbarIndex 不正确的问题 tabbarStore.setAutoCurIdx(path) + // 小程序里面使用平台自带的登录,则不走下面的逻辑 + if (IS_USE_WX_LOGIN_IN_MP) { + return true + } + const tokenStore = useTokenStore() FG_LOG_ENABLE && console.log('tokenStore.hasLogin:', tokenStore.hasLogin)