默认初始化页面权限修改

This commit is contained in:
张松 2025-04-02 17:16:47 +08:00
parent 6e815f90ec
commit 6362581516
1 changed files with 5 additions and 3 deletions

View File

@ -102,14 +102,16 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
BeanUtil.copyProperties(shopStaffEditDTO, shopStaff);
updateById(shopStaff);
if (shopStaffEditDTO.getShopPermissionIds() != null && !shopStaffEditDTO.getShopPermissionIds().isEmpty()) {
if (shopStaffEditDTO.getShopPermissionIds() != null ) {
shopStaffPermissionService.updateChain().eq(ShopStaffPermission::getStaffId, shopStaff.getId())
.eq(ShopStaffPermission::getShopId, StpKit.USER.getShopId()).eq(ShopStaffPermission::getUserId, shopStaff.getId()).remove();
// 权限添加
addPermission(shopStaff, shopStaffEditDTO.getShopPermissionIds());
if (!shopStaffEditDTO.getShopPermissionIds().isEmpty()) {
addPermission(shopStaff, shopStaffEditDTO.getShopPermissionIds());
}
}
if (shopStaffEditDTO.getPagePathIdList() != null && !shopStaffEditDTO.getPagePathIdList().isEmpty()) {
if (shopStaffEditDTO.getPagePathIdList() != null) {
PagePathPermissionAddDTO pagePathPermissionAddDTO = new PagePathPermissionAddDTO();
pagePathPermissionAddDTO.setPagePathIdList(shopStaffEditDTO.getPagePathIdList());
pagePathPermissionAddDTO.setStaffId(shopStaff.getId());