From 0a00cdf46e322547a90eb75374feaa4c6997656f Mon Sep 17 00:00:00 2001 From: COOL Date: Fri, 28 Jul 2023 18:38:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=B7=E6=96=B0token?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/user/service/login.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/user/service/login.ts b/src/modules/user/service/login.ts index ea9039c..9cead6b 100644 --- a/src/modules/user/service/login.ts +++ b/src/modules/user/service/login.ts @@ -72,7 +72,7 @@ export class UserLoginService extends BaseService { await this.userInfoEntity.insert(user); } return this.token({ id: user.id }); - }else{ + } else { throw new CoolCommException('验证码错误'); } } @@ -177,9 +177,9 @@ export class UserLoginService extends BaseService { throw new CoolCommException('token类型非refreshToken'); } const userInfo = await this.userInfoEntity.findOneBy({ - id: info['userId'], + id: info['id'], }); - return this.token(userInfo); + return this.token({ id: userInfo.id }); } catch (e) { throw new CoolCommException( '刷新token失败,请检查refreshToken是否正确或过期'