mirror of https://github.com/fantasticit/think.git
feat: update unauthorized exception message
This commit is contained in:
parent
b536166a0a
commit
d4ea2bf7e5
|
@ -11,7 +11,7 @@ export class JwtGuard extends AuthGuard('jwt') {
|
||||||
|
|
||||||
handleRequest(err, user) {
|
handleRequest(err, user) {
|
||||||
if (err || !user) {
|
if (err || !user) {
|
||||||
throw new UnauthorizedException('身份验证失败');
|
throw new UnauthorizedException('请登录后使用');
|
||||||
}
|
}
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||||
const ret = await this.userService.validateUser(user);
|
const ret = await this.userService.validateUser(user);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
throw new UnauthorizedException('身份验证失败');
|
throw new UnauthorizedException('请登录后使用');
|
||||||
}
|
}
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
|
|
Loading…
Reference in New Issue