默认初始化页面权限

This commit is contained in:
张松
2025-04-02 16:13:26 +08:00
parent 989945d85e
commit 7d311bb3a0
3 changed files with 37 additions and 5 deletions

View File

@@ -56,12 +56,10 @@ public class ShopPagePermissionController {
*/
@GetMapping("/detail")
public CzgResult<List<ShopPagePath>> detail(@RequestParam Long staffId) {
Set<Long> pageIdList = shopStaffPagePermissionService.list(new QueryWrapper().eq(ShopStaffPagePermission::getShopId,
StpKit.USER.getShopId()).eq(ShopStaffPagePermission::getStaffId, staffId)).stream().map(ShopStaffPagePermission::getPagePathId).collect(Collectors.toSet());
if (pageIdList.isEmpty()) {
return CzgResult.success(new ArrayList<>());
if (StpKit.USER.isStaff() && StpKit.USER.getLoginIdAsLong() != staffId) {
return CzgResult.failure("员工无权限");
}
return CzgResult.success(shopPagePathService.list(new QueryWrapper().in(ShopPagePath::getId, pageIdList)));
return CzgResult.success(shopPagePathService.detail(staffId));
}
/**