Browse Source

修复用户管理的bug

test
smallchill 6 years ago
parent
commit
013f2eede0
  1. 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java
  2. 11
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java
  3. 8
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

2
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));
}
/**

11
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<User> {
/**
* 新增或修改用户
* 新增用户
*
* @param user
* @return
*/
boolean submit(User user);
/**
* 修改用户
*
* @param user
* @return
*/
boolean updateUser(User user);
/**
* 自定义分页
*

8
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@ -53,7 +53,13 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> 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

Loading…
Cancel
Save