Class JwtStpInterface

java.lang.Object
io.github.xezzon.zeroweb.auth.JwtStpInterface
All Implemented Interfaces:
cn.dev33.satoken.stp.StpInterface

@Component public class JwtStpInterface extends Object implements cn.dev33.satoken.stp.StpInterface

ZeroWeb 的 StpInterface 实现类,用于 Sa-Token 框架。

该类通过从 JWT claims 中提取权限和角色信息,为 Sa-Token 提供认证授权服务。

Author:
xezzon
  • Constructor Details

    • JwtStpInterface

      public JwtStpInterface()
  • Method Details

    • getPermissionList

      public List<String> getPermissionList(Object loginId, String loginType)

      获取指定账号的权限列表。

      该方法从当前请求的 JWT claims 中提取权限列表。

      Specified by:
      getPermissionList in interface cn.dev33.satoken.stp.StpInterface
      Parameters:
      loginId - 账号 id
      loginType - 账号类型
      Returns:
      权限列表,如果未找到则返回空列表
    • getRoleList

      public List<String> getRoleList(Object loginId, String loginType)

      获取指定账号的角色列表。

      该方法从当前请求的 JWT claims 中提取角色列表。

      Specified by:
      getRoleList in interface cn.dev33.satoken.stp.StpInterface
      Parameters:
      loginId - 账号 id
      loginType - 账号类型
      Returns:
      角色列表,如果未找到则返回空列表