zhengyiming
2025-03-25 c02e7a8fe42de2a5796e95e573f9e6b6735e4d0d
apps/taro/src/hooks/user.ts
@@ -26,6 +26,8 @@
    return userStore.getCurrentUserInfo();
  }
  const isChannelAccount = computed(() => !!virtualUserId.value && true);
  return {
    user: userInfo,
    userDetail: userDetail,
@@ -35,6 +37,7 @@
    virtualPhoneNumber,
    wxCode,
    wxOpenId,
    isChannelAccount,
  };
}
@@ -95,7 +98,7 @@
      }
      if (!!code && !wxCode.value) {
        userStore.setWxCode(router.params.code ?? '');
        getLifePayWxIndentity(code);
        // getLifePayWxIndentity(code);
      }
    } catch (error) {}
  });
@@ -113,7 +116,9 @@
      let res = await blLifeRecharge.services.getLifePayWxIndentity(params, {
        showLoading: false,
      });
      userStore.setWxOpenId(res.openId);
      if (res.openId) {
        userStore.setWxOpenId(res.openId);
      }
      return res;
    } catch (error) {}
  }
@@ -126,11 +131,11 @@
  const { getLifePayWxIndentity } = useLifePayWxIndentity();
  async function ensureOpenId() {
    if (wxOpenId) {
    if (wxOpenId.value) {
      return wxOpenId.value;
    } else {
      let rea = await getLifePayWxIndentity(wxCode.value);
      return rea.openId;
      return rea.openId ? rea.openId : wxOpenId.value;
    }
  }