From 46325595bf2dc31a869414ef15a1a7041c6db93d Mon Sep 17 00:00:00 2001 From: Brian Lee <62791515+Lz020316@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:02:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=93=8D=E4=BD=9C=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AD=97=E5=85=B8=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htmlweb/web/backstage/system/user/list.html | 104 ++++++++++++++++++ .../admin/controller/UserController.java | 20 ++++ .../xiaoyao/admin/service/UserService.java | 2 + .../impl/DistionarytypeServiceImpl.java | 8 +- .../admin/service/impl/UserServiceImpl.java | 17 +++ .../src/main/resources/application-dev.yml | 10 +- 6 files changed, 152 insertions(+), 9 deletions(-) diff --git a/htmlweb/web/backstage/system/user/list.html b/htmlweb/web/backstage/system/user/list.html index b7b05a9c..a47b3e78 100644 --- a/htmlweb/web/backstage/system/user/list.html +++ b/htmlweb/web/backstage/system/user/list.html @@ -78,9 +78,52 @@ + + <#include "/head/footlist.html" /> diff --git a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/controller/UserController.java b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/controller/UserController.java index dfdf1064..31fb00f7 100644 --- a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/controller/UserController.java +++ b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/controller/UserController.java @@ -466,6 +466,26 @@ public class UserController extends BaseController{ return ResultVoUtil.error(); } } + + + /** + * 后台修改用户密码,重置为123456 + * @param request + * @param userid + * @return + */ + @GetMapping("/editUserPassword") + public @ResponseBody ResultVo editUserPassword(HttpServletRequest request,@RequestParam("userid") Long userid,@RequestParam("password") String password){ + + + int isok = this.userService.editUserPasswordAdmin(userid,password); + + if(isok > 0){ + return ResultVoUtil.success(); + }else { + return ResultVoUtil.error(); + } + } /** * 判断当前用户的密码是否为初始密码 diff --git a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/UserService.java b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/UserService.java index 3dec6afa..ed7040eb 100644 --- a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/UserService.java +++ b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/UserService.java @@ -221,4 +221,6 @@ public interface UserService extends BaseService { * @return */ public boolean enabledInvertUser(Long userid); + + int editUserPasswordAdmin(Long userid, String password); } diff --git a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/DistionarytypeServiceImpl.java b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/DistionarytypeServiceImpl.java index 555a65c6..32b698ce 100644 --- a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/DistionarytypeServiceImpl.java +++ b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/DistionarytypeServiceImpl.java @@ -50,10 +50,10 @@ public class DistionarytypeServiceImpl extends BaseServiceImpl list = distionarygroupMybatisDao.listByTypeId(dto.getId()); - - dto.setDistionarygroupList(list); + if (dto!=null){ + List list = distionarygroupMybatisDao.listByTypeId(dto.getId()); + dto.setDistionarygroupList(list); + } return dto; } public Distionarytype selectByCodeNo(String codeno){ diff --git a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/UserServiceImpl.java b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/UserServiceImpl.java index 199c01af..7e567f73 100644 --- a/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/UserServiceImpl.java +++ b/jyjz-system/jyjz-system-admin/src/main/java/cn/jyjz/xiaoyao/admin/service/impl/UserServiceImpl.java @@ -765,4 +765,21 @@ public class UserServiceImpl extends BaseServiceImpl imple return this.updateById(user); } + + @Override + public int editUserPasswordAdmin(Long userid, String password) { + //判断原始密码输入是否正确 + int isok = 0; + User old = this.selectDtoById(userid); + if (old != null){ + BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(); + User userps = new User(); + userps.setId(old.getId()); + //新密码 + userps.setPassword(bCryptPasswordEncoder.encode(password)); + //持久化用户新密码 + isok = this.usermybatisdao.updateById(userps); + } + return isok; + } } diff --git a/runstart/src/main/resources/application-dev.yml b/runstart/src/main/resources/application-dev.yml index a888977d..7df43463 100644 --- a/runstart/src/main/resources/application-dev.yml +++ b/runstart/src/main/resources/application-dev.yml @@ -160,15 +160,15 @@ mybatis-plus: xiaoyao: web: #上传文件路径 - uploadPath: /Users/sunchenliang/IdeaProjects/ocr/htmlweb/upload + uploadPath: D:\work\java\gitlab\ocr\htmlweb/upload #页面根路径 - frontPath: /Users/sunchenliang/IdeaProjects/ocr/htmlweb + frontPath: D:\work\java\gitlab\ocr\htmlweb #js、css、图片存放路径 - staticPath: /Users/sunchenliang/IdeaProjects/ocr/htmlweb/static + staticPath: D:\work\java\gitlab\ocr\htmlweb/static #页面模版路径 - webPath: /Users/sunchenliang/IdeaProjects/ocr/htmlweb/web + webPath: D:\work\java\gitlab\ocr\htmlweb/web #Lucene索引路径 - lucenePath: /Users/sunchenliang/IdeaProjects/ocr/htmlweb/lucene/indexDir + lucenePath: D:\work\java\gitlab\ocr\htmlweb/lucene/indexDir #是否开启flowable haveFlowable: true webconfig: