|
@@ -90,40 +90,39 @@ public class StoreUserController {
|
|
: R.fail("密码错误");
|
|
: R.fail("密码错误");
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("修改密码")
|
|
|
|
|
|
+ @ApiOperation("修改密码/忘记密码/更换绑定手机号")
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true),
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "newPhone", value = "新手机号", dataType = "String", paramType = "query"),
|
|
@ApiImplicitParam(name = "oldPassword", value = "旧密码", dataType = "String", paramType = "query"),
|
|
@ApiImplicitParam(name = "oldPassword", value = "旧密码", dataType = "String", paramType = "query"),
|
|
@ApiImplicitParam(name = "newPassword", value = "新密码", dataType = "String", paramType = "query", required = true),
|
|
@ApiImplicitParam(name = "newPassword", value = "新密码", dataType = "String", paramType = "query", required = true),
|
|
- @ApiImplicitParam(name = "type", value = "类型:0:忘记密码,其他:修改密码", dataType = "Integer", paramType = "query", required = true)})
|
|
|
|
|
|
+ @ApiImplicitParam(name = "confirmNewPassword", value = "新密码确认", dataType = "String", paramType = "query", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "verificationCode", value = "验证码", dataType = "String", paramType = "query", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "type", value = "类型:0:忘记密码,1:修改密码,2:更换绑定手机号", dataType = "Integer", paramType = "query", required = true)})
|
|
@GetMapping("/updatePassword")
|
|
@GetMapping("/updatePassword")
|
|
- public R<Boolean> updatePassword(String phone, String oldPassword, String newPassword, Integer type) {
|
|
|
|
- log.info("StoreUserController.updatePassword?phone={}&oldPassword={}&newPassword={}&type={}", phone, oldPassword, newPassword, type);
|
|
|
|
- StoreUser storeUser = storeUserService.getUserByPhone(phone);
|
|
|
|
- if (null != storeUser) {
|
|
|
|
- if (0 == type || oldPassword.equals(storeUser.getPassword())) {
|
|
|
|
- if (newPassword.equals(storeUser.getPassword())) {
|
|
|
|
- return R.fail("新密码与原密码相同");
|
|
|
|
- }
|
|
|
|
- if (storeUserService.updatePassword(storeUser.getId(), newPassword)) {
|
|
|
|
- return R.success("修改成功");
|
|
|
|
- }
|
|
|
|
- return R.fail("修改失败");
|
|
|
|
- }
|
|
|
|
- return R.fail("旧密码错误");
|
|
|
|
|
|
+ public R<Boolean> updatePassword(String phone,String newPhone, String oldPassword, String newPassword,String confirmNewPassword,String verificationCode,Integer type) {
|
|
|
|
+ log.info("StoreUserController.updatePassword?phone={}&newPhone&oldPassword={}&newPassword={}&confirmNewPassword={}&verificationCode={}&type={}", phone, newPhone, oldPassword, newPassword, confirmNewPassword, verificationCode, type);
|
|
|
|
+ boolean flag = false;
|
|
|
|
+ flag = storeUserService.forgetOrModifyPassword(phone, newPhone, oldPassword, newPassword, confirmNewPassword, verificationCode, type);
|
|
|
|
+ if(flag){
|
|
|
|
+ return R.success("密码修改成功");
|
|
|
|
+ }else {
|
|
|
|
+ return R.success("密码修改失败");
|
|
}
|
|
}
|
|
- return R.fail("手机号不存在");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("修改用户信息")
|
|
@ApiOperation("修改用户信息")
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "String", paramType = "query", required = true),
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "String", paramType = "query", required = true),
|
|
@ApiImplicitParam(name = "name", value = "姓名", dataType = "String", paramType = "query", required = true),
|
|
@ApiImplicitParam(name = "name", value = "姓名", dataType = "String", paramType = "query", required = true),
|
|
- @ApiImplicitParam(name = "idCard", value = "身份证", dataType = "String", paramType = "query", required = true)})
|
|
|
|
|
|
+ @ApiImplicitParam(name = "idCard", value = "身份证", dataType = "String", paramType = "query", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "nickName", value = "昵称", dataType = "String", paramType = "query", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "accountBlurb", value = "账号简介", dataType = "String", paramType = "query", required = true)})
|
|
|
|
+
|
|
@GetMapping("/setUserInfo")
|
|
@GetMapping("/setUserInfo")
|
|
- public R<Boolean> setUserInfo(Integer id, String name, String idCard) {
|
|
|
|
- log.info("StoreUserController.setUserInfo?id={}&name={}&idCard={}", id, name, idCard);
|
|
|
|
- if (storeUserService.setUserInfo(id, name, idCard)) {
|
|
|
|
|
|
+ public R<Boolean> setUserInfo(Integer id, String name, String idCard, String nickName, String accountBlurb) {
|
|
|
|
+ log.info("StoreUserController.setUserInfo?id={}&name={}&idCard={}&nickName={}}&accountBlurb={}", id, name, idCard, nickName, accountBlurb);
|
|
|
|
+ if (storeUserService.setUserInfo(id, name, idCard, nickName, accountBlurb)) {
|
|
return R.success("修改成功");
|
|
return R.success("修改成功");
|
|
}
|
|
}
|
|
return R.fail("修改失败");
|
|
return R.fail("修改失败");
|