解决权限问题

main
王家东 4 months ago
parent 497dde726d
commit 9f39a8a8a1
  1. 16
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java

@ -252,11 +252,11 @@ public class AnnualCompetitionProjectRegistrationController {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roles = getRoleByUserId(loginUser.getId()); List<String> roles = getRoleByUserId(loginUser.getId());
for (String role : roles) { for (String role : roles) {
if (role.equals("用户角色") || role.equals("学生")) { if (role.equals("user") || role.equals("xs")) {
List<String> eCodes = getEnrollCodeByUserId(loginUser.getId()); List<String> eCodes = getEnrollCodeByUserId(loginUser.getId());
queryWrapper.in("enroll_code", eCodes); queryWrapper.in("enroll_code", eCodes);
return; return;
} else if (role.equals("组委会")) { } else if (role.equals("committee")) {
List<AnnualCompPoint> annualCompPointList = annualCompPointService.query().eq("create_by", loginUser.getUsername()).list(); List<AnnualCompPoint> annualCompPointList = annualCompPointService.query().eq("create_by", loginUser.getUsername()).list();
List<String> aIds = new ArrayList<>(); List<String> aIds = new ArrayList<>();
aIds.add(""); aIds.add("");
@ -264,7 +264,7 @@ public class AnnualCompetitionProjectRegistrationController {
aIds.add(annualCompPoint.getId()); aIds.add(annualCompPoint.getId());
queryWrapper.in("annual_compid", aIds); queryWrapper.in("annual_compid", aIds);
return; return;
} else if (role.equals("学院") || role.equals("院系管理员")) { } else if (role.equals("superAdmin") || role.equals("Department")) {
List<String> departIds = getDepartIdsByUserId(loginUser.getId()); List<String> departIds = getDepartIdsByUserId(loginUser.getId());
List<String> userIdList = new ArrayList<>(); List<String> userIdList = new ArrayList<>();
List<String> enrollCodeList = new ArrayList<>(); List<String> enrollCodeList = new ArrayList<>();
@ -358,7 +358,7 @@ public class AnnualCompetitionProjectRegistrationController {
List<SysUserRole> userRoleList = sysUserRoleService.query().eq("user_id", userId).list(); List<SysUserRole> userRoleList = sysUserRoleService.query().eq("user_id", userId).list();
for (SysUserRole sysUserRole : userRoleList) { for (SysUserRole sysUserRole : userRoleList) {
SysRole sysRole = sysRoleService.query().eq("id", sysUserRole.getRoleId()).one(); SysRole sysRole = sysRoleService.query().eq("id", sysUserRole.getRoleId()).one();
roleList.add(sysRole.getRoleName()); roleList.add(sysRole.getRoleCode());
} }
return roleList; return roleList;
} }
@ -660,9 +660,9 @@ public class AnnualCompetitionProjectRegistrationController {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roles = getRoleByUserId(loginUser.getId()); List<String> roles = getRoleByUserId(loginUser.getId());
for (String role : roles) { for (String role : roles) {
if (role.equals("学生") || role.equals("用户角色")) if (role.equals("xs") || role.equals("user"))
return applicationRefusal(id); return applicationRefusal(id);
else if (role.equals("组委会")) else if (role.equals("committee"))
return refusalApplication(id); return refusalApplication(id);
} }
@ -729,9 +729,9 @@ public class AnnualCompetitionProjectRegistrationController {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roles = getRoleByUserId(loginUser.getId()); List<String> roles = getRoleByUserId(loginUser.getId());
for (String role : roles) { for (String role : roles) {
if (role.equals("学生")) if (role.equals("xs"))
return commitApplication(id); return commitApplication(id);
else if (role.equals("组委会")) else if (role.equals("committee"))
return passApplication(id); return passApplication(id);
} }

Loading…
Cancel
Save