diff --git a/packages/server/src/guard/document-auth.guard.ts b/packages/server/src/guard/document-auth.guard.ts index ab600cb2..0e2c4144 100644 --- a/packages/server/src/guard/document-auth.guard.ts +++ b/packages/server/src/guard/document-auth.guard.ts @@ -49,12 +49,12 @@ export class DocumentAuthorityGuard implements CanActivate { if (needAuth === 'createUser') { if (document.createUserId !== user.id) { - throw new HttpException('您不是该文档的创建者,无法删除', HttpStatus.FORBIDDEN); + throw new HttpException('您不是该文档的创建者,无法操作', HttpStatus.FORBIDDEN); } } else if (needAuth) { const authority = await this.documentService.getDocumentAuthority(documentId, user.id); if (!authority || !authority[needAuth]) { - throw new HttpException('您无权查看此文档', HttpStatus.FORBIDDEN); + throw new HttpException('您无权操作此文档', HttpStatus.FORBIDDEN); } } diff --git a/packages/server/src/guard/wiki-user.guard.ts b/packages/server/src/guard/wiki-user.guard.ts index cf7655ae..9256d8ee 100644 --- a/packages/server/src/guard/wiki-user.guard.ts +++ b/packages/server/src/guard/wiki-user.guard.ts @@ -46,7 +46,7 @@ export class WikiUserRoleGuard implements CanActivate { const wikiUser = await this.wikiService.findWikiUser(wikiId, user.id); if (!wikiUser && targetUserRole && wikiUser.userRole !== targetUserRole) { - throw new HttpException('您无权查看该知识库', HttpStatus.FORBIDDEN); + throw new HttpException('您无权操作该知识库', HttpStatus.FORBIDDEN); } return true;