mirror of https://github.com/fantasticit/think.git
fix: fix js error
This commit is contained in:
parent
b598c33fc5
commit
85a79127b0
|
@ -32,7 +32,8 @@ export class DocumentAuthorityGuard implements CanActivate {
|
|||
|
||||
const user = this.jwtService.decode(token) as IUser;
|
||||
const { params, query, body } = request;
|
||||
const documentId = params.id || params.documentId || query.id || query.documentId || body.documentId;
|
||||
const documentId = params?.id || params?.documentId || query?.id || query?.documentId || body?.documentId;
|
||||
|
||||
let document = null;
|
||||
|
||||
if (documentId) {
|
||||
|
|
|
@ -19,7 +19,7 @@ export class DocumentStatusGuard implements CanActivate {
|
|||
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const { params, query, body } = request;
|
||||
const documentId = params.id || params.documentId || query.id || query.documentId || body.documentId;
|
||||
const documentId = params?.id || params?.documentId || query?.id || query?.documentId || body?.documentId;
|
||||
|
||||
let document = null;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ export class WikiStatusGuard implements CanActivate {
|
|||
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const { params, query, body } = request;
|
||||
const wikiId = params.id || params.wikiId || query.id || query.wikiId || body.wikiId;
|
||||
const wikiId = params?.id || params?.wikiId || query?.id || query?.wikiId || body?.wikiId;
|
||||
|
||||
const wiki = await this.wikiService.findById(wikiId);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ export class WikiUserRoleGuard implements CanActivate {
|
|||
const user = this.jwtService.decode(token) as IUser;
|
||||
|
||||
const { params, query, body } = request;
|
||||
const wikiId = params.id || params.wikiId || query.id || query.wikiId || body.wikiId;
|
||||
const wikiId = params?.id || params?.wikiId || query?.id || query?.wikiId || body?.wikiId;
|
||||
|
||||
const wiki = await this.wikiService.findById(wikiId);
|
||||
|
||||
|
|
Loading…
Reference in New Issue