【优化】用户不能删除自己、表格在最后一页搜索跳转优化

This commit is contained in:
俞宝山 2025-12-24 14:43:59 +08:00
parent 89ef7fe062
commit 38fcc7d882
3 changed files with 9 additions and 1 deletions

View File

@ -576,7 +576,7 @@
}
// 0 ,
if (r.records.length === 0 && props.showPagination && data.localPagination.current > 1) {
data.localPagination.current--
data.localPagination.current = r.pages === 0 ? 1 : r.pages
loadData()
return
}

View File

@ -270,6 +270,10 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
if(containsSuperAdminAccount) {
throw new CommonException("不可删除系统内置超管人员");
}
// 不能删除自己
if (bizUserIdList.contains(StpUtil.getLoginIdAsString())) {
throw new CommonException("不可删除自己");
}
// 获取这些人员的的机构id集合
Set<String> userOrgIdList = this.listByIds(bizUserIdList).stream().map(BizUser::getOrgId).collect(Collectors.toSet());
// 校验数据范围

View File

@ -428,6 +428,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
if (containsSuperAdminAccount) {
throw new CommonException("不可删除系统内置超管用户");
}
// 不能删除自己
if (sysUserIdList.contains(StpUtil.getLoginIdAsString())) {
throw new CommonException("不可删除自己");
}
// 清除将这些用户作为主管的信息
this.update(new LambdaUpdateWrapper<SysUser>().in(SysUser::getDirectorId, sysUserIdList).set(SysUser::getDirectorId, null));