Commit a2ce79e9 authored by 技术部-任文超's avatar 技术部-任文超

这种bug就应该拖出去罚裸蹲

parent 34b3ac53
......@@ -263,7 +263,7 @@ public class UserController implements IBaseController {
log.info("用户注册失败,密码不能为空:register -> registerFrom:{}, phoneNo:{}, password:{}", registerFrom, phoneNo, password);
return JsonResult.buildErrorStateResult("密码不能为空", null);
}
if (ValidationUtil.validatePassword(password)) {
if (!ValidationUtil.validatePassword(password)) {
log.info("用户注册失败,{}:register -> registerFrom:{}, phoneNo:{}, password:{}", PasswordUtil.TOAST_MSG, registerFrom, phoneNo, password);
return JsonResult.buildErrorStateResult(PasswordUtil.TOAST_MSG, null);
}
......@@ -336,7 +336,7 @@ public class UserController implements IBaseController {
if (StringUtils.isBlank(password)) {
return JsonResult.buildErrorStateResult("密码不能为空", null);
}
if (ValidationUtil.validatePassword(password)) {
if (!ValidationUtil.validatePassword(password)) {
return JsonResult.buildErrorStateResult(PasswordUtil.TOAST_MSG, null);
}
verifyPhoneAndCode(phoneNo, verificationCode);
......@@ -365,7 +365,7 @@ public class UserController implements IBaseController {
if (StringUtils.isBlank(passwordNew)) {
return JsonResult.buildErrorStateResult("密码不能为空", null);
}
if (ValidationUtil.validatePassword(password)) {
if (!ValidationUtil.validatePassword(password)) {
return JsonResult.buildErrorStateResult(PasswordUtil.TOAST_MSG, null);
}
User user = userService.findByPhoneWithCache(phoneNo);
......
......@@ -1341,12 +1341,11 @@ public class InnerController implements IBaseController {
@RequestMapping(path = "/user/password/reset", method = RequestMethod.POST)
public JsonResult resetPassword(@RequestParam("phone") String phone, @RequestParam(required = false) String password) {
if (ValidationUtil.validatePhoneNo(phone)) {
if (StringUtils.isNotBlank(password) && !ValidationUtil.validatePassword(password)) {
return JsonResult.buildErrorStateResult(PasswordUtil.TOAST_MSG, null);
}
// 默认重置的密码是123456
if(StringUtils.isBlank(password)){
password = PasswordUtil.PASSWORD_DEFAULT;
}else if (!ValidationUtil.validatePassword(password)) {
return JsonResult.buildErrorStateResult(PasswordUtil.TOAST_MSG, null);
}
try {
boolean result = userService.resetPassword(phone, password);
......
Markdown is supported
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