|
@@ -208,12 +208,21 @@ public class StudentController extends ControllerSupport {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "修改用户密码", notes = "修改密码")
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param password
|
|
|
+ * @param newPassword
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "修改学生密码", notes = "修改密码")
|
|
|
@PutMapping("password")
|
|
|
- public Long stuPassword(@RequestParam("oldPassword") String oldPassword,
|
|
|
- @RequestParam("newPassword") String newPassword, HttpServletRequest request) {
|
|
|
+ public Long updateStudentPassword(@RequestParam("password") String password,
|
|
|
+ @RequestParam("newPassword") String newPassword) {
|
|
|
User accessUser = getAccessUser();
|
|
|
- if (StringUtils.isEmpty(oldPassword)) {
|
|
|
+ if (StringUtils.isEmpty(password)) {
|
|
|
throw new StatusException("B-450110", "旧密码为空");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(newPassword)) {
|
|
@@ -225,7 +234,7 @@ public class StudentController extends ControllerSupport {
|
|
|
|
|
|
Student s = studentRepo.findOne(accessUser.getStudentId());
|
|
|
|
|
|
- if (StringUtils.isNotBlank(s.getPassword()) && !s.getPassword().equals(oldPassword)) {
|
|
|
+ if (StringUtils.isNotBlank(s.getPassword()) && !s.getPassword().equals(password)) {
|
|
|
throw new StatusException("B-450111", "当前密码错误");
|
|
|
}
|
|
|
s.setPassword(newPassword);
|