From d6ae9eb36186a924800d7e0433c3eb35c5ccb6f7 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 11 八月 2025 15:10:15 +0800 Subject: [PATCH] fix: 修改登录 --- apps/cMiniApp/src/stores/modules/user.ts | 52 ++++++++++++++++++++++++++-------------------------- 1 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/cMiniApp/src/stores/modules/user.ts b/apps/cMiniApp/src/stores/modules/user.ts index 21cf5ab..39b8df7 100644 --- a/apps/cMiniApp/src/stores/modules/user.ts +++ b/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) { -- Gitblit v1.9.1