From 9afcd6e64b7e7a9d63e5024b63a2fd5d3b027593 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Tue, 30 Dec 2025 20:17:14 +0800 Subject: [PATCH] =?UTF-8?q?fear:=20[=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=20[=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86]=20=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hxhq/system/service/ISysUserService.java | 16 ++++++++++++++++ .../com/hxhq/system/service/impl/SysUserServiceImpl.java | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java index b7dfbb4..cafeca6 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java @@ -233,4 +233,20 @@ public interface ISysUserService * @return */ List selectDeptAndUser(); + + /** + * 检查密码是否正确 + * @param userId + * @param password + * @return + */ + Boolean checkPassword(Long userId,String password); + + /** + * 检查密码是否正确 + * @param user + * @param password + * @return + */ + Boolean checkPassword(SysUser user,String password); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java index 3115697..4f61e8a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java @@ -579,4 +579,15 @@ public class SysUserServiceImpl implements ISysUserService public List selectDeptAndUser() { return userMapper.selectDeptAndUser(); } + + @Override + public Boolean checkPassword(Long userId, String password) { + SysUser user = selectUserById(userId); + return checkPassword(user,password); + } + + @Override + public Boolean checkPassword(SysUser user, String password) { + return SecurityUtils.matchesPassword(password,user.getPassword()); + } }