mirror of
https://gitee.com/xiaonuobase/snowy.git
synced 2025-12-25 23:56:20 +08:00
【优化】用户不能删除自己、表格在最后一页搜索跳转优化
This commit is contained in:
parent
89ef7fe062
commit
38fcc7d882
@ -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
|
||||
}
|
||||
|
||||
@ -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());
|
||||
// 校验数据范围
|
||||
|
||||
@ -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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user