public class JWTUtil extends Object
Constructor and Description |
---|
JWTUtil() |
Modifier and Type | Method and Description |
---|---|
static Principal |
getPrincipal(String token)
获取当前用户
|
static String[] |
getRoles(String token)
获取角色组
|
static String |
getUsername(String token) |
static String |
sign(String username,
String userId,
List<String> roles,
String secret)
生成签名
|
static boolean |
verify(String token,
String username,
String secret)
校验token是否正确
|
Copyright © 2019. All rights reserved.