| | |
| | | */ |
| | | async person(id) { |
| | | const info = await this.userInfoEntity.findOneBy({ id: Equal(id) }); |
| | | delete info.password; |
| | | //delete info.password; |
| | | return info; |
| | | } |
| | | |
| | |
| | | { id: userId }, |
| | | { |
| | | status: 2, |
| | | phone: null, |
| | | unionid: null, |
| | | phone: "", |
| | | unionid: "", |
| | | nickName: `已注销-00${userId}`, |
| | | avatarUrl: null, |
| | | avatarUrl: "", |
| | | } |
| | | ); |
| | | } |
| | |
| | | uuid() + '.png' |
| | | ); |
| | | } |
| | | } catch (err) {} |
| | | } catch (err) { } |
| | | try { |
| | | return await this.userInfoEntity.update({ id }, param); |
| | | } catch (err) { |
| | |
| | | * @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), |
| | | }); |
| | | } |
| | | |
| | | /** |