|
|
@@ -479,7 +479,12 @@ public class PublicController extends BaseController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户名"));
|
|
|
return res;
|
|
|
}
|
|
|
- User user=userService.selectByNameAndType(mobile, type);
|
|
|
+ User user=userService.selectByMobieAndType(mobile, type);
|
|
|
+ if(user==null || user.getMobile()==null || !user.getMobile().equals(mobile))
|
|
|
+ {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "手机号或用户名错误"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
user.setPassword(newPwd);
|
|
|
user.setPassword(passwordUtil.getEncryptPwd(user));
|
|
|
userService.updateByPrimaryKeySelective(user);
|
|
|
@@ -494,9 +499,8 @@ public class PublicController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/checkMNCode", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public Result checkMNCode(String mobileCode,String userName,String mobile) {
|
|
|
+ public Result checkMNCode(String mobileCode,Integer type,String mobile) {
|
|
|
Result res = new Result();
|
|
|
-
|
|
|
if (StringUtils.isBlank(mobileCode)) {
|
|
|
res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "手机验证码"));
|
|
|
return res;
|
|
|
@@ -505,8 +509,8 @@ public class PublicController extends BaseController {
|
|
|
res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "手机号"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(userName)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "用户名"));
|
|
|
+ if (null==type) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "帐号类型"));
|
|
|
return res;
|
|
|
}
|
|
|
if (TimeUtils.checkOverTime(VerifyCodeUtils.M_CODE)) {
|
|
|
@@ -519,7 +523,7 @@ public class PublicController extends BaseController {
|
|
|
res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "", "手机验证码错误"));
|
|
|
return res;
|
|
|
}
|
|
|
- User user=userService.selectByNameAndType(userName, null);
|
|
|
+ User user=userService.selectByMobieAndType(mobile, type);
|
|
|
if(user==null || user.getMobile()==null || !user.getMobile().equals(mobile))
|
|
|
{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "手机号或用户名错误"));
|