From be10ce7e8e790c0bb48842218cd7ae7020e5b470 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期四, 06 三月 2025 15:58:54 +0800 Subject: [PATCH] fix: 修改打包 --- apps/taro/src/hooks/user.ts | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/taro/src/hooks/user.ts b/apps/taro/src/hooks/user.ts index e651456..d30eebd 100644 --- a/apps/taro/src/hooks/user.ts +++ b/apps/taro/src/hooks/user.ts @@ -58,7 +58,6 @@ const isAuth = computed(() => !needAuth || isLogin.value); const router = Taro.useRouter(); - console.log('222', 222); useInitWeixinJSBridge(); Taro.useReady(async () => { @@ -88,8 +87,10 @@ Taro.useReady(async () => { try { //@ts-ignore - if (!code && isInWeChat && !wxCode.value) { - location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf940ff1d35a98493&redirect_uri=${location.href}&response_type=code&scope=snsapi_base#wechat_redirect`; + if (!code && isInWeChat && !wxCode.value && location?.replace) { + location.replace( + `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf940ff1d35a98493&redirect_uri=${location.href}&response_type=code&scope=snsapi_base#wechat_redirect` + ); } if (!!code && !wxCode.value) { userStore.setWxCode(router.params.code ?? ''); -- Gitblit v1.9.1