From 013f2eede0ba3999077da127946e99b02dd7f231 Mon Sep 17 00:00:00 2001 From: smallchill Date: Sat, 3 Aug 2019 00:32:35 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/user/controller/UserController.java | 2 +- .../springblade/system/user/service/IUserService.java | 11 ++++++++++- .../system/user/service/impl/UserServiceImpl.java | 8 +++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java index 26222133..cbaacbc2 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java @@ -104,7 +104,7 @@ public class UserController { @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @CacheEvict(cacheNames = {USER_CACHE}, allEntries = true) public R update(@Valid @RequestBody User user) { - return R.status(userService.submit(user)); + return R.status(userService.updateUser(user)); } /** diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java index b915ad59..e1f5bf82 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java @@ -30,12 +30,21 @@ import org.springblade.system.user.entity.UserInfo; public interface IUserService extends BaseService { /** - * 新增或修改用户 + * 新增用户 + * * @param user * @return */ boolean submit(User user); + /** + * 修改用户 + * + * @param user + * @return + */ + boolean updateUser(User user); + /** * 自定义分页 * diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java index 369e8ddc..9fada1f9 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java @@ -53,7 +53,13 @@ public class UserServiceImpl extends BaseServiceImpl implement if (cnt > 0 && Func.isEmpty(user.getId())) { throw new ApiException("当前用户已存在!"); } - return saveOrUpdate(user); + return save(user); + } + + @Override + public boolean updateUser(User user) { + user.setPassword(null); + return updateById(user); } @Override