zhengyiming
2 天以前 afb9410b3794275c180cdd66e3ca54fd32888d33
apps/cMiniApp/src/stores/modules/user.ts
@@ -31,7 +31,7 @@
  userInfo?: Nullable<API.LoginCommandCallback>;
  token?: Nullable<string>;
  refreshToken?: Nullable<string>;
  userDetail?: Nullable<API.UserInfoV2>;
  userDetail?: Nullable<API.GetPersonalLoginInfoQueryResult>;
  firstGetUserDetail?: boolean;
  locationCity?: string;
@@ -86,7 +86,7 @@
    },
    userId: (state) => {
      return state.userInfo?.id ?? '';
      return state.userDetail?.id ?? '';
    },
  },
  actions: {
@@ -152,7 +152,6 @@
      try {
        this.setUserInfoAction(res);
        this.setTokenAction(res);
        myClient.refetchQueries();
        await this.getCurrentUserInfo();
      } catch (error) {}
    },
@@ -189,19 +188,19 @@
    },
    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) {}
      try {
        let res = await authServices.getPersonalLoginInfo({}, { showLoading: false });
        if (res) {
          // res.frontStatus = getUserCertificationFrontStatusAdapter(
          //   res.userCertificationStatus,
          //   res.userCertificationAuditStatus
          // );
          res.originalAvatar = res.avatar;
          res.avatar = res.avatar ? setOSSLink(res.avatar) : DefaultAvatar;
          this.setUserDetail(res);
          this.firstGetUserDetail = false;
        }
      } catch (error) {}
    },
    setTokenAction(tokenInfo: API.LoginCommandCallback) {
@@ -217,7 +216,7 @@
      setUserInfo(this.userInfo);
    },
    setUserDetail(detail: API.UserInfoV2) {
    setUserDetail(detail: API.GetPersonalLoginInfoQueryResult) {
      this.userDetail = detail;
      setUserDetail(detail);
    },