From 1274a6a494e77123bd6e83af7ba103e85c5bbba8 Mon Sep 17 00:00:00 2001 From: CD <1103614279@qq.com> Date: Mon, 10 Oct 2022 17:47:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9B=B4=E6=8E=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ExtRepoFolderController.java | 36 +++++++++++++++++++ jero-web/src/views/externalReports/index.vue | 18 +++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java index 0b3dc9680..0e04edc29 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java @@ -99,6 +99,42 @@ public class ExtRepoFolderController extends JeroController isAllowSiblingFolder(@RequestParam(name="id",required=true) String id, + @RequestParam(name = "cut", defaultValue = "cn") String cut, + HttpSession session) { + Result result = new Result(); + session.setAttribute("haveSuperiorManageAuth", false); + ExtRepoFolder folder = extRepoFolderService.queryById(id); + extRepoFolderService.haveSuperiorManageAuth(folder.getSupFolder(),session); + //上层是否有权限 + boolean boo = (Boolean)session.getAttribute("haveSuperiorManageAuth"); + if (boo || extRepoFolderService.haveManageAuth(id)) { + if (!boo) { + if (CutEnum.CN.getValue().equals(cut)) { + return result.error500("无法创建同级文件夹!请联系管理员!"); + } else { + return result.error500("Unable to create a sibling folder ! Please Contact your administrator !"); + } + } + } else { + if (CutEnum.CN.getValue().equals(cut)) { + return result.error500("没有权限!"); + } else { + return result.error500("You do not have permission !"); + } + } + return result.success(""); + } + /** * 编辑 * diff --git a/jero-web/src/views/externalReports/index.vue b/jero-web/src/views/externalReports/index.vue index be267168a..1922e15ec 100644 --- a/jero-web/src/views/externalReports/index.vue +++ b/jero-web/src/views/externalReports/index.vue @@ -619,7 +619,23 @@ export default { let supFolder = '' this.supFolder = this.nodeItem.key this.addSub = false - this.menuRightVisible = true + let params = {} + let long = localStorage.getItem('language') + let cut = '' + if (long && long == 'zh-cn') { + this.cut = 'cn' + } else if (long && long == 'en-us') { + this.cut = 'en' + } + params.id = this.supFolder + params.cut = this.cut + postAction(`extRepo/extRepoFolder/isAllowSiblingFolder`, params).then(res => { + if (res.success) { + this.menuRightVisible = true + } else { + this.$message.warning(res.message) + } + }) }, orgAdds(){