mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-04-11 13:03:17 +08:00
update 统一框架所有主键id均使用雪花id
This commit is contained in:
@@ -109,7 +109,7 @@ public class SysUser extends BaseEntity {
|
||||
}
|
||||
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_ID.equals(this.userId);
|
||||
return SystemConstants.SUPER_ADMIN_USER_ID.equals(this.userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class SysRoleBo implements Serializable {
|
||||
}
|
||||
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_ID.equals(this.roleId);
|
||||
return SystemConstants.SUPER_ADMIN_ROLE_ID.equals(this.roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -138,7 +138,7 @@ public class SysUserBo implements Serializable {
|
||||
}
|
||||
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_ID.equals(this.userId);
|
||||
return SystemConstants.SUPER_ADMIN_USER_ID.equals(this.userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SysRoleVo implements Serializable {
|
||||
private boolean flag = false;
|
||||
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_ID.equals(this.roleId);
|
||||
return SystemConstants.SUPER_ADMIN_ROLE_ID.equals(this.roleId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
||||
*/
|
||||
@Override
|
||||
public void checkRoleAllowed(SysRoleBo role) {
|
||||
if (ObjectUtil.isNotNull(role.getRoleId()) && LoginHelper.isSuperAdmin(role.getRoleId())) {
|
||||
if (ObjectUtil.isNotNull(role.getRoleId()) && SystemConstants.SUPER_ADMIN_ROLE_ID.equals(role.getRoleId())) {
|
||||
throw new ServiceException("不允许操作超级管理员角色");
|
||||
}
|
||||
String[] keys = new String[]{SystemConstants.SUPER_ADMIN_ROLE_KEY};
|
||||
|
||||
@@ -479,7 +479,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
|
||||
// 非超级管理员,禁止包含超级管理员角色
|
||||
if (!LoginHelper.isSuperAdmin(userId)) {
|
||||
roleList.remove(SystemConstants.SUPER_ADMIN_ID);
|
||||
roleList.remove(SystemConstants.SUPER_ADMIN_ROLE_ID);
|
||||
}
|
||||
|
||||
// 移除超管角色后若无剩余角色,说明仅选了超管角色且不允许分配,显式报错
|
||||
|
||||
Reference in New Issue
Block a user