mirror of https://github.com/fantasticit/think.git
fix: check is user login
This commit is contained in:
parent
fb16c0a0e9
commit
806467c5e4
|
@ -34,6 +34,10 @@ export class WikiUserRoleGuard implements CanActivate {
|
|||
|
||||
const user = this.jwtService.decode(token) as IUser;
|
||||
|
||||
if (!user) {
|
||||
throw new HttpException('请登录', HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
const { params, query, body } = request;
|
||||
const wikiId = params?.id || params?.wikiId || query?.id || query?.wikiId || body?.wikiId;
|
||||
|
||||
|
|
Loading…
Reference in New Issue