dev
liuguijing 1 year ago
commit 523ec042c5

@ -199,5 +199,9 @@ public class Constants {
*/
public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis() / 1000 - 1672502400)); // Based On 2023-01-01 00:00:00
/**
*
*/
public static int SUPER_ADMIN = 1;
}

@ -19,13 +19,13 @@ import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import static com.shxy.xymanager_common.constant.Constants.SUPER_ADMIN;
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class RoleServiceImpl implements RoleService {
int adminId = 1;
@Resource
TbRoleMapper roleMapper;
@Resource
@ -70,7 +70,7 @@ public class RoleServiceImpl implements RoleService {
@Override
public void changePermission(Integer roleId, List<TbPermission> list) throws Exception {
if (roleId == adminId) {
if (roleId == SUPER_ADMIN) {
throw new Exception("不能修改admin的权限");
}
TbPermissionExample example = new TbPermissionExample();

Loading…
Cancel
Save