查询登录用户权限信息,使用UserUtils

This commit is contained in:
2023-11-11 16:28:23 +08:00
parent 40bf1f4a15
commit 659705e70d
2 changed files with 11 additions and 3 deletions

View File

@@ -77,9 +77,10 @@ public class MemberBasicInfoController extends BaseController {
RestApiResponse<?> response = null; RestApiResponse<?> response = null;
// List<MerchantInfoVO> list = memberBasicInfoService.getMerchantListByAuth(deptIds); // List<MerchantInfoVO> list = memberBasicInfoService.getMerchantListByAuth(deptIds);
// List<MerchantInfoVO> list = memberBasicInfoService.getMerchantListByAuth(); // List<MerchantInfoVO> list = memberBasicInfoService.getMerchantListByAuth();
List<MerchantInfoVO> list = UserUtils.getMerchantListByAuth(); // List<MerchantInfoVO> list = UserUtils.getMerchantListByAuth();
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail(); LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail)); logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
List<MerchantInfoVO> list = loginUserDetail.getMerchantInfoVOList();
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
list = new ArrayList<>(); list = new ArrayList<>();
} }

View File

@@ -92,7 +92,7 @@ public class UserUtils {
/** /**
* 获取当前会员中的运营商列表(带权限校验) * 获取当前会员中的运营商列表(带权限校验)
*/ */
public static List<MerchantInfoVO> getMerchantListByAuth() { /*public static List<MerchantInfoVO> getMerchantListByAuth() {
List<MerchantInfoVO> resultList = Lists.newArrayList(); List<MerchantInfoVO> resultList = Lists.newArrayList();
// 获取登录用户 所有有权限运营商 // 获取登录用户 所有有权限运营商
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
@@ -135,8 +135,15 @@ public class UserUtils {
} }
} }
return resultList; return resultList;
} }*/
/**
* 获取登录用户信息
* 返回信息包含:
* 一级运营商idList
* 有权限的运营商信息list
* @return LoginUserDetailVO 登录用户详情VO
*/
public static LoginUserDetailVO getLoginUserDetail() { public static LoginUserDetailVO getLoginUserDetail() {
LoginUserDetailVO resultVO = new LoginUserDetailVO(); LoginUserDetailVO resultVO = new LoginUserDetailVO();