liusheng
2025-04-02 acd62c1684cbde71954252ffdf89d0918491e6fc
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -17,6 +17,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -60,6 +61,9 @@
    @Autowired
    protected Validator validator;
    @Value("${isAdmin}")
    private List<Long> isAdmin;
    /**
     * 根据条件分页查询用户列表
@@ -353,7 +357,7 @@
     */
    @Override
    public void checkUserAllowed(SysUser user) {
        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
        if (StringUtils.isNotNull(user.getUserId()) && isAdmin.contains(user.getUserId())) {
            throw new ServiceException("不允许操作超级管理员用户");
        }
    }
@@ -365,7 +369,7 @@
     */
    @Override
    public void checkUserDataScope(Long userId) {
        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
        if (!isAdmin.contains(SecurityUtils.getUserId())) {
            SysUser user = new SysUser();
            user.setUserId(userId);
            List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);