close #1 使用模板新建文档错误

This commit is contained in:
fantasticit 2022-02-21 08:55:36 +08:00
parent b5339569c7
commit b164e750fd
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ export class TemplateService {
*/ */
async useTemplate(user: OutUser, templateId) { async useTemplate(user: OutUser, templateId) {
const data = await this.templateRepo.findOne(templateId); const data = await this.templateRepo.findOne(templateId);
if (user.id !== data.createUserId) { if (user.id !== data.createUserId && !data.isPublic) {
throw new HttpException( throw new HttpException(
'您不是模板创建者,无法编辑', '您不是模板创建者,无法编辑',
HttpStatus.FORBIDDEN, HttpStatus.FORBIDDEN,