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()); + } }