@ -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));
}
/**
@ -30,12 +30,21 @@ import org.springblade.system.user.entity.UserInfo;
public interface IUserService extends BaseService<User> {
* 新增或修改用户
* 新增用户
*
* @param user
* @return
*/
boolean submit(User user);
* 修改用户
boolean updateUser(User user);
* 自定义分页
@ -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);