超管判断

This commit is contained in:
2026-08-17 11:22:47 +08:00
parent cf33feb7d0
commit 77a629ee64
2 changed files with 13 additions and 2 deletions
@@ -5,6 +5,7 @@ import com.yunhai.bschclassmanage.utils.UserContext;
import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.platform.openapi.client.YschBaseOpenApi;
import com.yunhai.platform.utils.model.BoaModule;
import com.yunhai.platform.utils.model.BoaUser;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -21,6 +22,16 @@ import java.util.List;
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
public class LoginUserController {
@GetMapping("getUserMod")
public List<BoaModule> getUserMod() {
return YschBaseOpenApi.getUserModule(UserContext.getUserId(),UserContext.getSchId());
}
@GetMapping("getUserInfo")
public BoaUser getUserInfo(BoaUser authUserWithDept) {
return authUserWithDept;
}
@GetMapping("Logout")
protected void logout(HttpServletRequest request) {
HttpSession session = request.getSession();
@@ -40,7 +40,7 @@ public class SchsystemController {
Integer roleId = UserContext.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
boolean isAreaAdmin = !isSuperAdmin && UserRole.AREAADMIN.getValue().equals(roleId);
if (!isSuperAdmin && !isAreaAdmin) {
throw new DException("无权操作,仅超级管理员或学校管理员可设置学制");
@@ -82,7 +82,7 @@ public class SchsystemController {
// 2. 角色权限校验
Integer roleId = user.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
boolean isAreaAdmin =!isSuperAdmin && UserRole.AREAADMIN.getValue().equals(roleId);
if (!isSuperAdmin && !isAreaAdmin) {
throw new DException("无权操作,仅超级管理员或学校管理员可设置学制");