zhengyiming
2025-03-06 753ada68e666932bd8e5071ef8177ea729f6a58c
apps/taro/src/hooks/user.ts
@@ -87,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 ?? '');