zhengyiming
2025-03-06 ad032ad0889156572271868601d6665e560318b4
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 ?? '');