master:停用代发增加管理员权限校验;

pull/1121/head
liujiang 2025-11-20 10:16:50 +08:00
parent 92bfb2fb9a
commit bcc2f45484
1 changed files with 4 additions and 0 deletions

View File

@ -168,6 +168,10 @@ public class UserAuthenticationServiceImpl implements IUserAuthenticationService
@Override
@Transactional
public Integer updateDelFlag(UserAuthUpdateDelFlagDTO updateDelFlagDTO) {
// 用户是否为超级管理员
if (!SecurityUtils.isSuperAdmin()) {
throw new ServiceException("当前用户非超级管理员,无权限操作!", HttpStatus.ERROR);
}
UserAuthentication userAuth = Optional.ofNullable(this.userAuthMapper.selectOne(new LambdaQueryWrapper<UserAuthentication>()
.eq(UserAuthentication::getId, updateDelFlagDTO.getUserAuthId())))
.orElseThrow(() -> new ServiceException("代发不存在!", HttpStatus.ERROR));