|
@@ -346,4 +346,15 @@ public class PersonnelService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
|
return personnelVOS;
|
|
|
}
|
|
|
|
|
|
+ public String changePwd(String oldPassword, String newPassword) {
|
|
|
+ Integer userId = StpUtil.getLoginIdAsInt();
|
|
|
+ Personnel personnel = this.getById(userId);
|
|
|
+ boolean isPassword = SecureUtil.md5(oldPassword).equals(personnel.getPersonnelPassword());
|
|
|
+ if (!isPassword) {
|
|
|
+ return Response.error("旧密码错误");
|
|
|
+ }
|
|
|
+ personnel.setPersonnelPassword(SecureUtil.md5(newPassword));
|
|
|
+ personnel.updateById();
|
|
|
+ return Response.success(true);
|
|
|
+ }
|
|
|
}
|