MaiXinRong пре 3 недеља
родитељ
комит
af981094be
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      app/service/file.js

+ 3 - 3
app/service/file.js

@@ -82,7 +82,7 @@ module.exports = app => {
             const filing = await this.ctx.service.filing.getDataById(fileDatas[0].filing_id);
             if (this.ctx.subProject.permission.file_permission.indexOf(this.ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) {
                 for (const file of fileDatas) {
-                    if (file.user_id !== this.ctx.session.sessionUser.accountId && ctx.subProject.permission.file_permission.indexOf(ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) throw '无权删除文件';
+                    if (file.user_id !== this.ctx.session.sessionUser.accountId && this.ctx.subProject.permission.file_permission.indexOf(this.ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) throw '无权删除文件';
                 }
             }
             const result = {};
@@ -132,7 +132,7 @@ module.exports = app => {
         async saveFile(id, filename){
             const file = await this.getDataById(id);
             if (!file) throw '文件不存在';
-            if (file.user_id !== this.ctx.session.sessionUser.accountId && ctx.subProject.permission.file_permission.indexOf(ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) throw '您无权编辑该文件';
+            if (file.user_id !== this.ctx.session.sessionUser.accountId && this.ctx.subProject.permission.file_permission.indexOf(this.ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) throw '您无权编辑该文件';
 
             const info = path.parse(filename);
             const updateData = { id, filename: info.name, fileext: info.ext};
@@ -143,7 +143,7 @@ module.exports = app => {
         async moveFile(id, filing_id) {
             const file = await this.getDataById(id);
             if (!file) throw '文件不存在';
-            if (file.user_id !== this.ctx.session.sessionUser.accountId && ctx.subProject.permission.file_permission.indexOf(ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) throw '您无权编辑该文件';
+            if (file.user_id !== this.ctx.session.sessionUser.accountId && this.ctx.subProject.permission.file_permission.indexOf(this.ctx.service.subProjPermission.PermissionConst.file.editfile.value) < 0) throw '您无权编辑该文件';
             const orgFiling = await this.ctx.service.filing.getDataById(file.filing_id);
             const filing = await this.ctx.service.filing.getDataById(filing_id);
             if (!filing) throw '目标分类不存在';