新增直接提示

This commit is contained in:
CD
2022-10-10 17:47:18 +08:00
parent e213f55f34
commit 1274a6a494
2 changed files with 53 additions and 1 deletions
@@ -99,6 +99,42 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
return result;
}
/**
* 是否允许增加同级文件夹
* @param id
* @return
*/
@AutoLog(value = "是否允许增加同级文件夹")
@ApiOperation(value = "是否允许增加同级文件夹", notes = "是否允许增加同级文件夹")
@PostMapping(value = "/isAllowSiblingFolder")
public Result<?> isAllowSiblingFolder(@RequestParam(name="id",required=true) String id,
@RequestParam(name = "cut", defaultValue = "cn") String cut,
HttpSession session) {
Result<ExtRepoFolder> 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("");
}
/**
* 编辑
*
+17 -1
View File
@@ -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(){