From 5c279293be74423a0ccde5432f601894720a9dcf Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Jul 2022 14:57:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2=E5=90=8E=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=8D=E8=83=BD=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/service/sys/SysUserService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index ef35534000..8fbf8d6cbc 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -1,8 +1,8 @@ package io.dataease.service.sys; import io.dataease.auth.api.dto.CurrentUserDto; +import io.dataease.auth.service.AuthUserService; import io.dataease.auth.service.ExtAuthService; -import io.dataease.controller.sys.base.ConditionEntity; import io.dataease.controller.sys.request.*; import io.dataease.ext.ExtSysUserAssistMapper; import io.dataease.ext.ExtSysUserMapper; @@ -11,7 +11,6 @@ import io.dataease.commons.constants.AuthConstants; import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.BeanUtils; import io.dataease.commons.utils.CodingUtil; -import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.response.SysUserGridResponse; import io.dataease.controller.sys.response.SysUserRole; import io.dataease.i18n.Translator; @@ -57,6 +56,9 @@ public class SysUserService { @Resource private ExtSysUserAssistMapper extSysUserAssistMapper; + @Resource + private AuthUserService authUserService; + public List query(UserGridRequest request) { String keyWord = request.getKeyWord(); @@ -199,7 +201,6 @@ public class SysUserService { * @param request * @return */ - @CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId") @Transactional public int update(SysUserCreateRequest request) { checkUsername(request); @@ -214,6 +215,7 @@ public class SysUserService { deleteUserRoles(user.getUserId());//先删除用户角色关联 saveUserRoles(user.getUserId(), request.getRoleIds());//再插入角色关联 if (ObjectUtils.isEmpty(user.getDeptId())) user.setDeptId(0L); + authUserService.clearCache(user.getUserId()); return sysUserMapper.updateByPrimaryKeySelective(user); } @@ -240,7 +242,7 @@ public class SysUserService { * @param request * @return */ - @CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId") + @Transactional public int updatePersonBasicInfo(SysUserCreateRequest request) { checkEmail(request); @@ -252,6 +254,7 @@ public class SysUserService { user.setEmail(request.getEmail()); user.setNickName(request.getNickName()); user.setPhone(request.getPhone()); + authUserService.clearCache(request.getUserId()); return sysUserMapper.updateByPrimaryKeySelective(user); }