config and user bug
This commit is contained in:
@@ -130,24 +130,32 @@ public class MyUserController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改用户信息
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:user:update")
|
||||
public R update(@RequestBody MyUserEntity user){
|
||||
|
||||
if (!StringUtils.isEmpty(user.getPassword())) {
|
||||
String password = user.getPassword();
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
userService.updateById(user);
|
||||
}else{
|
||||
userService.update(user);
|
||||
}
|
||||
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户密码
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateUserPassword")
|
||||
public R updateUserPassword(@RequestBody MyUserEntity user){
|
||||
String password = user.getPassword();
|
||||
if(password.equals(null)){
|
||||
return R.error("密码不能为空");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user