zhengyiming
2025-03-24 21b418f4ffb8e76d72819e8d489b3179154cb0c1
apps/taro/src/hooks/user.ts
@@ -95,7 +95,7 @@
      }
      if (!!code && !wxCode.value) {
        userStore.setWxCode(router.params.code ?? '');
        getLifePayWxIndentity(code);
        // getLifePayWxIndentity(code);
      }
    } catch (error) {}
  });
@@ -113,7 +113,9 @@
      let res = await blLifeRecharge.services.getLifePayWxIndentity(params, {
        showLoading: false,
      });
      if (res.openId) {
      userStore.setWxOpenId(res.openId);
      }
      return res;
    } catch (error) {}
  }
@@ -126,11 +128,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;
    }
  }