租户数据权限

pull/4/head
perry 2023-05-30 10:59:55 +08:00
parent ff84ef642c
commit fe860b399a
2 changed files with 5 additions and 5 deletions

View File

@ -103,10 +103,9 @@ public class RechargeOrderController {
@PreAuthorize("@ss.hasPermission('shop:recharge-order:query')") @PreAuthorize("@ss.hasPermission('shop:recharge-order:query')")
@TenantIgnore @TenantIgnore
public CommonResult<PageResult<RechargeOrderRespVO>> getRechargeOrderPage(@Valid RechargeOrderPageReqVO pageVO) { public CommonResult<PageResult<RechargeOrderRespVO>> getRechargeOrderPage(@Valid RechargeOrderPageReqVO pageVO) {
if(!TenantContextHolder.ID_SYSTEM.equals(TenantContextHolder.getRequiredTenantId())){ if(!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())){
pageVO.setTenantId(TenantContextHolder.getRequiredTenantId());
}
pageVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId()); pageVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
}
PageResult<RechargeOrderRespVO> pageResult = rechargeOrderService.getRechargeOrderPage(pageVO); PageResult<RechargeOrderRespVO> pageResult = rechargeOrderService.getRechargeOrderPage(pageVO);
return success(pageResult); return success(pageResult);
} }

View File

@ -4,6 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
@ -102,8 +103,8 @@ public class AdminUserController {
@PreAuthorize("@ss.hasPermission('member:user:query')") @PreAuthorize("@ss.hasPermission('member:user:query')")
@TenantIgnore @TenantIgnore
public CommonResult<PageResult<AdminUserInfoRespVO>> findPageList(@RequestBody AdminUserQueryDTO queryDTO) { public CommonResult<PageResult<AdminUserInfoRespVO>> findPageList(@RequestBody AdminUserQueryDTO queryDTO) {
if(!TenantContextHolder.ID_SYSTEM.equals(TenantContextHolder.getRequiredTenantId())){ if(!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())){
queryDTO.setTenantId(TenantContextHolder.getRequiredTenantId()); queryDTO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
} }
// 获得用户分页列表 // 获得用户分页列表
PageResult<MemberUserDO> pageResult = userService.findPageList(queryDTO); PageResult<MemberUserDO> pageResult = userService.findPageList(queryDTO);