在上传文件时增加对密级的判断

master
Guo XIn 1 year ago
parent 0b78bcecf7
commit e3a5e7b77f
  1. 4
      shandan-bianmu/src/main/resources/static/js/business/directory/directory.js
  2. 10
      shandan-system/src/main/resources/static/js/sys/file/dirUpload.js

@ -193,7 +193,7 @@ function startRender() {
}) })
metaListTable.addTableRowEvent('addFile', function () { metaListTable.addTableRowEvent('addFile', function () {
upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}`, function (res) { upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}&secretLevel=${basicData.secretLevel}`, function (res) {
if (res.success) { if (res.success) {
refreshDirectoryNode(tempNode, basicData); refreshDirectoryNode(tempNode, basicData);
metaListTable.reloadTable(); metaListTable.reloadTable();
@ -205,7 +205,7 @@ function startRender() {
}); });
metaListTable.addTableRowEvent('addDirectory', function (obj) { metaListTable.addTableRowEvent('addDirectory', function (obj) {
upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}&dirUpload=true`, function (res) { upload(basicData, `${ctx}/sys/file/layer/dir?directoryId=${basicData.id}&secretLevel=${basicData.secretLevel}&dirUpload=true`, function (res) {
if (res.success) { if (res.success) {
refreshPermis().then(() => { refreshPermis().then(() => {
refreshDirectoryNode(tempNode, basicData); refreshDirectoryNode(tempNode, basicData);

@ -46,6 +46,14 @@ layui.use(['layer', 'uploader', 'element', 'form', 'laydate', 'dict', 'datalabel
showErrorMsg("请选择文件密级"); showErrorMsg("请选择文件密级");
return false; return false;
} }
if(json['secretLevel'] > param.secretLevel){
layer.alert('禁止上传超过当前目录数据密级的文件,当前目录的密级为【'+ DICT.getText('secret_level', param.secretLevel) +'】', {icon:2})
return false;
}
if(json['secretLevel'] > user.secretLevel){
layer.alert('禁止上传超过自身涉密等级的文件,您的涉密等级为【'+ DICT.getText('secret_level', user.secretLevel) +'】', {icon:2})
return false;
}
if (json.exerciseData === '1') { if (json.exerciseData === '1') {
if (uploader.getFiles().length <= 0) { if (uploader.getFiles().length <= 0) {
showErrorMsg("还没有选择文件"); showErrorMsg("还没有选择文件");
@ -75,7 +83,7 @@ layui.use(['layer', 'uploader', 'element', 'form', 'laydate', 'dict', 'datalabel
showErrorMsg('装备型号不能为空') showErrorMsg('装备型号不能为空')
return false; return false;
} }
;
} }
$('#fileUploadAction').addClass('layui-disabled').attr('disabled', 'true') $('#fileUploadAction').addClass('layui-disabled').attr('disabled', 'true')
uploader.uploadToServer(); uploader.uploadToServer();