|
|
@ -581,13 +581,20 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Boolean checkPassword(Long userId, String password) { |
|
|
|
|
|
SysUser user = selectUserById(userId); |
|
|
|
|
|
return checkPassword(user,password); |
|
|
|
|
|
|
|
|
public Boolean checkPassword(Long userId, String password, Boolean needName) { |
|
|
|
|
|
SysUser sysUser = selectUserById(userId); |
|
|
|
|
|
if(sysUser==null){ |
|
|
|
|
|
throw new ServiceException("用户不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
return checkPassword(sysUser,password,needName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Boolean checkPassword(SysUser user, String password) { |
|
|
|
|
|
return SecurityUtils.matchesPassword(password,user.getPassword()); |
|
|
|
|
|
|
|
|
public Boolean checkPassword(SysUser user, String password, Boolean needName) { |
|
|
|
|
|
if(SecurityUtils.matchesPassword(password,user.getPassword())){ |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
throw new ServiceException((needName?user.getNickName():"")+"密码错误"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |