wupengfei
2025-03-10 6887129e91d32557c2b57178180329f46df09d12
apps/bMiniApp/src/stores/modules/user.ts
@@ -13,7 +13,7 @@
  setMatchMakingIdentity,
} from '@/utils/storage/auth';
import * as accountServices from '@12333/services/api/Account';
import * as userServices from '@12333/services/api/User';
// import * as userServices from '@12333/services/api/User';
import Taro, { useRouter } from '@tarojs/taro';
import { ButtonProps } from '@tarojs/components';
import { debounce } from 'lodash';
@@ -115,7 +115,7 @@
            sessionKey: wxMiniAppUserLoginRes.sessionKey,
            encryptedData: detail.encryptedData,
            iv: detail.iv,
            wxMiniApp: WxMiniAppEnum.人单合一,
            wxMiniApp: WxMiniAppEnum.C端小程序,
          };
          res = await accountServices.wxMiniAppPhoneAuthLogin(params);
          this.loginSuccess(res);
@@ -161,7 +161,7 @@
      try {
        this.setUserInfoAction(res);
        this.setTokenAction(res);
        await this.getCurrentUserInfo();
        // await this.getCurrentUserInfo();
      } catch (error) {}
    },
@@ -189,28 +189,28 @@
          sessionKey: wxIndentityRes.sessionKey,
          encryptedData: detail.encryptedData,
          iv: detail.iv,
          wxMiniApp: WxMiniAppEnum.人单合一,
          wxMiniApp: WxMiniAppEnum.C端小程序,
        });
        this.loginSuccess(res);
        return res;
      } catch (error) {}
    },
    async getCurrentUserInfo() {
      try {
        let res = await userServices.getUserInfo({ showLoading: false });
        if (res) {
          res.frontStatus = getUserCertificationFrontStatusAdapter(
            res.userCertificationStatus,
            res.userCertificationAuditStatus
          );
          res.originalAvatarUrl = res.avatarUrl;
          res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
          this.setUserDetail(res);
          this.firstGetUserDetail = false;
        }
      } catch (error) {}
    },
    // async getCurrentUserInfo() {
    //   try {
    //     let res = await userServices.getUserInfo({ showLoading: false });
    //     if (res) {
    //       res.frontStatus = getUserCertificationFrontStatusAdapter(
    //         res.userCertificationStatus,
    //         res.userCertificationAuditStatus
    //       );
    //       res.originalAvatarUrl = res.avatarUrl;
    //       res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
    //       this.setUserDetail(res);
    //       this.firstGetUserDetail = false;
    //     }
    //   } catch (error) {}
    // },
    setTokenAction(tokenInfo: API.IdentityModelTokenCacheItem) {
      this.token = tokenInfo?.accessToken;