|
|
@@ -20,6 +20,7 @@ import com.uas.platform.b2b.model.User;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
+import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
import com.uas.platform.core.util.encry.Md5Utils;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
@@ -110,14 +111,13 @@ public class UserController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 修改用户基本信息
|
|
|
+ * 验证用户输入的密码是否正确
|
|
|
* @param email
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/checkPassword", method = RequestMethod.GET)
|
|
|
public ResponseEntity<String> checkPassword(String password) {
|
|
|
User user = SystemSession.getUser();
|
|
|
- System.out.println(user.getUserPwd());
|
|
|
if(!StringUtils.isEmpty(password)) {
|
|
|
boolean result = user.getUserPwd().equals(Md5Utils.encode(password, user.getUserUU()));
|
|
|
if(result) {
|
|
|
@@ -128,4 +128,20 @@ public class UserController {
|
|
|
return new ResponseEntity<String>(HttpStatus.EXPECTATION_FAILED);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改用户密码
|
|
|
+ * @param email
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
|
|
|
+ public ResponseEntity<String> updatePassword(String password, String newPassword) {
|
|
|
+ User user = SystemSession.getUser();
|
|
|
+ if(!StringUtils.isEmpty(newPassword)) {
|
|
|
+ userService.updatePassword(user, password, newPassword);
|
|
|
+ logger.log("用户信息", "修改用户密码,UU:" + user.getUserUU());
|
|
|
+ return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
+ }else
|
|
|
+ throw new IllegalOperatorException("新密码不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
}
|