mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
查询登录用户权限信息,使用UserUtils
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
package com.jsowell.common.util;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.HttpStatus;
|
||||
import com.jsowell.common.core.domain.entity.SysDept;
|
||||
import com.jsowell.common.core.domain.entity.SysRole;
|
||||
import com.jsowell.common.core.domain.entity.SysUser;
|
||||
import com.jsowell.common.core.domain.model.LoginUser;
|
||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||
import com.jsowell.common.exception.ServiceException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 安全服务工具类
|
||||
*
|
||||
@@ -108,7 +100,7 @@ public class SecurityUtils {
|
||||
}
|
||||
|
||||
// 查询登录用户权限
|
||||
public static AuthorizedDeptVO getAuthorizedMap() {
|
||||
/*public static AuthorizedDeptVO getAuthorizedMap() {
|
||||
// 登录用户
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
@@ -130,7 +122,6 @@ public class SecurityUtils {
|
||||
resultVO.setDeptId(deptId);
|
||||
log.info("用户id:{}, 所属部门信息:{}", user.getUserId(), JSONObject.toJSONString(dept));
|
||||
// 登录用户角色
|
||||
List<SysRole> roles = user.getRoles();
|
||||
Long parentId = dept.getParentId();
|
||||
resultVO.setParentId(String.valueOf(parentId));
|
||||
List<String> merchantDeptIds = Lists.newArrayList();
|
||||
@@ -147,5 +138,5 @@ public class SecurityUtils {
|
||||
resultVO.setStationDeptIds(stationDeptIds);
|
||||
}
|
||||
return resultVO;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user