wupengfei
6 天以前 fb531cbb7ceca6e4c28288b5a988a2700a065c59
apps/cMiniApp/src/stores/modules/user.ts
@@ -9,8 +9,6 @@
  getUserDetail,
  removeUserDetail,
} from '@/utils/storage/auth';
import * as accountServices from '@12333/services/api/Account';
import * as userServices from '@12333/services/api/User';
import Taro, { useRouter } from '@tarojs/taro';
import { ButtonProps } from '@tarojs/components';
import { debounce } from 'lodash';
@@ -24,7 +22,6 @@
  md5Encrypt,
} from '@12333/utils';
import DefaultAvatar from '@/assets/components/icon-default-avatar.png';
import { WxMiniAppEnum } from '@12333/constants';
import { myClient } from '@/constants/query';
import { globalEventEmitter } from '@12333/hooks';
import * as authServices from '@12333/services/apiV2/auth';
@@ -161,15 +158,15 @@
    },
    async wxMiniAppUserLoginFromScan(wxIndentityRes: API.WxMiniAppIndentityInfo, uuid: string) {
      try {
        let res = await accountServices.wxMiniAppUserLoginFromScan({
          uId: uuid,
          userName: wxIndentityRes.userName,
          openId: wxIndentityRes.openId,
        });
        this.loginSuccess(res);
        return res;
      } catch (error) {}
      // try {
      //   let res = await accountServices.wxMiniAppUserLoginFromScan({
      //     uId: uuid,
      //     userName: wxIndentityRes.userName,
      //     openId: wxIndentityRes.openId,
      //   });
      //   this.loginSuccess(res);
      //   return res;
      // } catch (error) {}
    },
    async wxMiniAppPhoneAuthLoginFromScan(
@@ -177,18 +174,18 @@
      wxIndentityRes: API.WxMiniAppIndentityInfo,
      uuid: string
    ) {
      try {
        let res = await accountServices.wxMiniAppPhoneAuthLoginFromScan({
          uId: uuid,
          openId: wxIndentityRes.openId,
          sessionKey: wxIndentityRes.sessionKey,
          encryptedData: detail.encryptedData,
          iv: detail.iv,
          wxMiniApp: WxMiniAppEnum.C端小程序,
        });
        this.loginSuccess(res);
        return res;
      } catch (error) {}
      // try {
      //   let res = await accountServices.wxMiniAppPhoneAuthLoginFromScan({
      //     uId: uuid,
      //     openId: wxIndentityRes.openId,
      //     sessionKey: wxIndentityRes.sessionKey,
      //     encryptedData: detail.encryptedData,
      //     iv: detail.iv,
      //     wxMiniApp: WxMiniAppEnum.C端小程序,
      //   });
      //   this.loginSuccess(res);
      //   return res;
      // } catch (error) {}
    },
    async getCurrentUserInfo() {
@@ -213,8 +210,11 @@
    },
    setUserInfoAction(info: API.LoginCommandCallback) {
      this.userInfo = info;
      setUserInfo(info);
      this.userInfo = {
        ...this.userInfo,
        ...info,
      };
      setUserInfo(this.userInfo);
    },
    setUserDetail(detail: API.UserInfoV2) {