From 665ba0f9ae078c2859209451a163d10515171d11 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期四, 13 八月 2026 12:05:48 +0800
Subject: [PATCH] add 预约和回收订单

---
 src/modules/user/service/info.ts |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/modules/user/service/info.ts b/src/modules/user/service/info.ts
index 62f2017..58dd8fd 100644
--- a/src/modules/user/service/info.ts
+++ b/src/modules/user/service/info.ts
@@ -46,7 +46,7 @@
    */
   async person(id) {
     const info = await this.userInfoEntity.findOneBy({ id: Equal(id) });
-    delete info.password;
+    //delete info.password;
     return info;
   }
 
@@ -59,10 +59,10 @@
       { id: userId },
       {
         status: 2,
-        phone: null,
-        unionid: null,
+        phone: "",
+        unionid: "",
         nickName: `宸叉敞閿�-00${userId}`,
-        avatarUrl: null,
+        avatarUrl: "",
       }
     );
   }
@@ -85,7 +85,7 @@
           uuid() + '.png'
         );
       }
-    } catch (err) {}
+    } catch (err) { }
     try {
       return await this.userInfoEntity.update({ id }, param);
     } catch (err) {
@@ -99,13 +99,21 @@
    * @param password
    * @param 楠岃瘉鐮�
    */
-  async updatePassword(userId, password, code) {
-    const user = await this.userInfoEntity.findOneBy({ id: userId });
+  async updatePassword(userId: string, password: string, code: string) {
+    const user = await this.userInfoEntity.findOneBy({ unionid: userId });
+
+    if (!user) {
+      throw new CoolCommException('鐢ㄦ埛涓嶅瓨鍦�');
+    }
+
     const check = await this.userSmsService.checkCode(user.phone, code);
     if (!check) {
       throw new CoolCommException('楠岃瘉鐮侀敊璇�');
     }
-    await this.userInfoEntity.update(user.id, { password: md5(password) });
+
+    await this.userInfoEntity.update(user.unionid, {
+      password: md5(password),
+    });
   }
 
   /**

--
Gitblit v1.9.1