From 831fcc96945f94965a37910e81b8393f72378ccf Mon Sep 17 00:00:00 2001 From: Guo XIn <371864209@qq.com> Date: Wed, 28 Jun 2023 15:29:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=95=B4=E7=BC=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=9C=A8=E6=A0=B9=E7=9B=AE=E5=BD=95=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=AD=89?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=8A=A0=E5=AF=B9=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/business/directory/directory.js | 9 +++++++++ shandan-common/src/main/resources/view/common/head.html | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/shandan-bianmu/src/main/resources/static/js/business/directory/directory.js b/shandan-bianmu/src/main/resources/static/js/business/directory/directory.js index a14b604..4c75d92 100644 --- a/shandan-bianmu/src/main/resources/static/js/business/directory/directory.js +++ b/shandan-bianmu/src/main/resources/static/js/business/directory/directory.js @@ -143,6 +143,10 @@ function startRender() { */ metaListTable.addTableRowEvent('moveLink', function () { var table = layui.table, checkStatus = table.checkStatus('dirMetadataTable'), data = checkStatus.data; + if (basicData.id === 'ROOT' && !USER_ROLES.includes('ROLE_SA')){ + layer.msg('没有权限'); + return; + } if (data.length < 1) { layer.confirm("请选择要移动的文件!", function (index) { layer.close(index); @@ -188,6 +192,7 @@ function startRender() { } }) metaListTable.addTableRowEvent('addFile', function () { + upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}`, function (res) { if (res.success) { refreshDirectoryNode(tempNode, basicData); @@ -277,6 +282,10 @@ function startRender() { } function upload(basicData, url, callback) { + if (basicData.id === 'ROOT' && !USER_ROLES.includes('ROLE_SA')){ + layer.msg('没有权限'); + return; + } if (basicData.reviewStatus == ReviewStatus.PASS || basicData.reviewStatus == ReviewStatus.SUBMITTED) { addDataConfirm(open); } else { diff --git a/shandan-common/src/main/resources/view/common/head.html b/shandan-common/src/main/resources/view/common/head.html index d93748f..2176679 100644 --- a/shandan-common/src/main/resources/view/common/head.html +++ b/shandan-common/src/main/resources/view/common/head.html @@ -27,6 +27,14 @@ if (!publicKey || publicKey == 'null' || publicKey != newPublicKey) { sessionStorage.setItem('javaPublicKey', newPublicKey); } + + const USER_ROLE_LIST = /*[[${userRoles}]]*/ []; + const USER_ROLES = []; + if(USER_ROLE_LIST.length > 0){ + for(const role of USER_ROLE_LIST){ + USER_ROLES.push(role.roleName); + } + }