类 AuthHelper

java.lang.Object
cool.scx.ext.auth.AuthHelper

public final class AuthHelper extends Object

AuthHelper class.

版本:
1.15.4
作者:
scx567888
  • 构造器详细资料

    • AuthHelper

      public AuthHelper()
  • 方法详细资料

    • getToken

      public static String getToken(io.vertx.ext.web.RoutingContext ctx)
      根据 设备类型自行判断 获取 token
      参数:
      ctx - a RoutingContext object
      返回:
      a String object
    • getDeviceTypeByHeader

      public static DeviceType getDeviceTypeByHeader(io.vertx.ext.web.RoutingContext routingContext)
      获取用户的设备
      参数:
      routingContext - a RoutingContext object
      返回:
      a
    • getTokenFromCookie

      public static String getTokenFromCookie(io.vertx.ext.web.RoutingContext routingContext)
      根据 cookie 获取 token
      参数:
      routingContext - a RoutingContext object
      返回:
      a String object
    • getTokenFromHeader

      public static String getTokenFromHeader(io.vertx.ext.web.RoutingContext routingContext)
      根据 Header 获取 token
      参数:
      routingContext - a
      返回:
      a a
    • tryGetAuthToken

      public static String tryGetAuthToken(io.vertx.ext.web.RoutingContext ctx, DeviceType loginDevice) throws AuthException
      尝试获取一个可以作为认证的 Token 具体获取方式由设备类型决定
      参数:
      ctx - a RoutingContext object
      loginDevice - a DeviceType object
      返回:
      a String object
      抛出:
      AuthException - if any.
    • checkPassword

      public static boolean checkPassword(String plainPassword, String encryptedPassword)
      校验密码
      参数:
      plainPassword - a
      encryptedPassword - a
      返回:
      a
    • mergePermsModels

      public static Perms mergePermsModels(List<PermsModel> permsModelList)

      mergePermsModels.

      参数:
      permsModelList - a List object
      返回:
      a Perms object