Commit 713d7156 authored by Menethil's avatar Menethil
Browse files

Merge remote-tracking branch 'origin/master'

parents 8b59fa57 a4a84d40
......@@ -89,6 +89,12 @@ public class AdminUserController {
public Object update(@LoginAdmin Integer adminId, @RequestBody LitemallUser user){
logger.debug(user);
// 用户密码加密存储
String password = user.getPassword();
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
String encodedPassword = encoder.encode(password);
user.setPassword(encodedPassword);
userService.update(user);
return ResponseUtil.ok(user);
}
......
package org.linlinjava.litemall.core.config;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -17,11 +18,17 @@ public class GlobalExceptionHandler {
return ResponseUtil.badArgumentValue();
}
@ExceptionHandler(HttpMessageNotReadableException.class)
@ResponseBody
public Object httpMessageNotReadableHandler(HttpMessageNotReadableException e){
e.printStackTrace();
return ResponseUtil.badArgumentValue();
}
@ExceptionHandler(Exception.class)
@ResponseBody
public Object exceptionHandler(Exception e){
e.printStackTrace();
return ResponseUtil.serious();
}
}
......@@ -326,7 +326,6 @@ public class WxAuthController {
user = userList.get(0);
}
// TODO 重新生成的密码无法登陆
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
String encodedPassword = encoder.encode(password);
user.setPassword(encodedPassword);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment