From 55c03f35a31979aefd46aead13a145c9b293e6d8 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 27 三月 2025 17:38:55 +0800
Subject: [PATCH] fix: 四期需求

---
 apps/taro/src/stores/modules/user.ts |  104 ++++++++++++++++++++++++++--------------------------
 1 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/apps/taro/src/stores/modules/user.ts b/apps/taro/src/stores/modules/user.ts
index 41ff362..1ac1d0e 100644
--- a/apps/taro/src/stores/modules/user.ts
+++ b/apps/taro/src/stores/modules/user.ts
@@ -14,7 +14,6 @@
   LoginVirtualRes,
 } from '@/utils/storage/auth';
 import * as accountServices from '@life-payment/services/api/Account';
-import * as userServices from '@life-payment/services/api/User';
 import Taro, { useRouter } from '@tarojs/taro';
 import { ButtonProps } from '@tarojs/components';
 import { debounce } from 'lodash';
@@ -110,37 +109,38 @@
       wxMiniAppUserLoginRes: any
     ) {
       try {
-        let res: API.IdentityModelTokenCacheItem;
-        if (!wxMiniAppUserLoginRes.accessToken) {
-          let params: API.WxMiniAppPhoneLoginInput = {
-            openId: wxMiniAppUserLoginRes.openId,
-            sessionKey: wxMiniAppUserLoginRes.sessionKey,
-            encryptedData: detail.encryptedData,
-            iv: detail.iv,
-            // wxMiniApp: WxMiniAppEnum.C绔皬绋嬪簭,
-          };
-          res = await accountServices.wxMiniAppPhoneAuthLogin(params);
-          this.loginSuccess(res);
-        }
-        return res;
+        // let res: API.IdentityModelTokenCacheItem;
+        // if (!wxMiniAppUserLoginRes.accessToken) {
+        //   let params: API.WxMiniAppPhoneLoginInput = {
+        //     openId: wxMiniAppUserLoginRes.openId,
+        //     sessionKey: wxMiniAppUserLoginRes.sessionKey,
+        //     encryptedData: detail.encryptedData,
+        //     iv: detail.iv,
+        //     // wxMiniApp: WxMiniAppEnum.C绔皬绋嬪簭,
+        //   };
+        //   res = await accountServices.wxMiniAppPhoneAuthLogin(params);
+        //   this.loginSuccess(res);
+        // }
+        // return res;
+        return 1;
       } catch (error) {
         console.log('error3: ', error);
       }
     },
 
     // 鐢ㄦ埛鎵嬫満楠岃瘉鐮佺櫥鍏�
-    async loginByUsername(data: API.PhoneMesssageCodeLoginInput) {
+    async loginByUsername(data: any) {
       let res = await accountServices.lifePayPhoneMesssageCodeLogin(
         {
           phoneNumber: data.phoneNumber,
-          code: data.code,
+          // code: data.code,
         },
         { showLoading: false }
       );
 
       if (res) {
         this.loginVirtualSuccess({
-          virtualUserId: res,
+          virtualUserId: res.userId,
           virtualPhoneNumber: data.phoneNumber,
         });
       }
@@ -149,17 +149,17 @@
 
     // 鐢ㄦ埛璐﹀彿瀵嗙爜鐧诲叆
     async loginByPassword(data: API.AccessRequestDto) {
-      let res = await accountServices.passwordLogin(
-        {
-          loginName: data.userName,
-          password: data.userPassword,
-        },
-        { showLoading: false }
-      );
-      if (res) {
-        this.loginSuccess(res);
-      }
-      return res;
+      // let res = await accountServices.passwordLogin(
+      //   {
+      //     loginName: data.userName,
+      //     password: data.userPassword,
+      //   },
+      //   { showLoading: false }
+      // );
+      // if (res) {
+      //   this.loginSuccess(res);
+      // }
+      // return res;
     },
 
     async loginSuccess(res: API.IdentityModelTokenCacheItem) {
@@ -185,13 +185,14 @@
 
     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;
+        // let res = await accountServices.wxMiniAppUserLoginFromScan({
+        //   uId: uuid,
+        //   userName: wxIndentityRes.userName,
+        //   openId: wxIndentityRes.openId,
+        // });
+        // this.loginSuccess(res);
+        // return res;
+        return 1;
       } catch (error) {}
     },
 
@@ -201,28 +202,27 @@
       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;
+        // 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;
+        return 1;
       } catch (error) {}
     },
 
     async getCurrentUserInfo() {
       try {
-        let res = await userServices.getUserInfo({ showLoading: false });
-        if (res) {
-          res.originalAvatarUrl = res.avatarUrl;
-          res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
-          this.setUserDetail(res);
-          this.firstGetUserDetail = false;
-        }
+        // let res = await userServices.getUserInfo({ showLoading: false });
+        // if (res) {
+        //   this.setUserDetail(res);
+        //   this.firstGetUserDetail = false;
+        // }
       } catch (error) {}
     },
 

--
Gitblit v1.9.1