feat: update unauthorized exception message

pull/26/head
fantasticit 2022-04-13 08:44:16 +08:00
parent b536166a0a
commit d4ea2bf7e5
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ export class JwtGuard extends AuthGuard('jwt') {
handleRequest(err, user) {
if (err || !user) {
throw new UnauthorizedException('身份验证失败');
throw new UnauthorizedException('请登录后使用');
}
return user;
}

View File

@ -34,7 +34,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
const ret = await this.userService.validateUser(user);
if (!ret) {
throw new UnauthorizedException('身份验证失败');
throw new UnauthorizedException('请登录后使用');
}
return user;