角色完善

This commit is contained in:
张松
2025-03-11 19:02:33 +08:00
parent aa00bacfca
commit f3d4aa2da8
3 changed files with 4 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ public class RoleController {
@SaAdminCheckPermission(value = "role:list", name = "角色列表")
@GetMapping("/list")
public CzgResult<Page<SysRole>> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
return CzgResult.success(roleService.getList(pageDTO, key, startTime, endTime));
return CzgResult.success(roleService.getList(StpKit.USER.getShopId(), pageDTO, key, startTime, endTime));
}
/**

View File

@@ -19,7 +19,7 @@ public interface SysRoleService extends IService<SysRole> {
List<SysRole> getByUserId(Long id);
Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime);
Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime);
Boolean add(RoleAddDTO roleAddDTO);

View File

@@ -46,8 +46,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
}
@Override
public Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
QueryWrapper queryWrapper = new QueryWrapper();
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
QueryWrapper queryWrapper = new QueryWrapper().eq(SysRole::getShopId, shopId);
if (!StpKit.USER.isAdmin()) {
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
}