|
@@ -74,23 +74,18 @@ public class UserController extends BaseController {
|
|
|
@ApiOperation(value = "设置密码")
|
|
|
@PostMapping(value = "/setPassword",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "authCode", value = "验证码", required = true, dataType = "String"),
|
|
|
@ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String") })
|
|
|
- public Object setPassword(String mobile,String authCode,String password) {
|
|
|
- if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(authCode) || StringUtils.isEmpty(password)){
|
|
|
+ public Object setPassword(String mobile,String password) {
|
|
|
+ if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(password)){
|
|
|
return failed();
|
|
|
}
|
|
|
SysUser sysUser = sysUserService.queryByPhone(mobile);
|
|
|
if(sysUser == null){
|
|
|
return failed("用户不存在");
|
|
|
}
|
|
|
- if(smsCodeService.verifyValidCode(mobile, authCode)){
|
|
|
- password = new BCryptPasswordEncoder().encode(password);
|
|
|
- sysUserService.updatePassword(mobile,password);
|
|
|
- return succeed();
|
|
|
- }else {
|
|
|
- return failed("验证码错误");
|
|
|
- }
|
|
|
+ password = new BCryptPasswordEncoder().encode(password);
|
|
|
+ sysUserService.updatePassword(mobile,password);
|
|
|
+ return succeed();
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "修改密码")
|