You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
3 years ago
|
package com.eco.plugin.xxxx.ncgdjtsso.utils;
|
||
|
|
||
|
import java.util.HashMap;
|
||
|
import java.util.Map;
|
||
|
|
||
|
public class JwtUtil {
|
||
|
|
||
|
private static JwtTokenValidator jwtTokenValidator;
|
||
|
|
||
|
public final static String ATTR_JWT_MAP = "jwt_map";
|
||
|
public final static String JWT_HEADER = "iplat-jwt";
|
||
|
public final static String USERNAME_KEY = "sub";
|
||
|
public final static String JWT_SOURCE = "jwt-source";
|
||
|
public final static String JWT_SOURCE_HEADER = "header";
|
||
|
|
||
|
public static JwtTokenValidator getJwtTokenValidator() {
|
||
|
if(jwtTokenValidator == null) {
|
||
|
setJwtTokenValidator();
|
||
|
}
|
||
|
return jwtTokenValidator;
|
||
|
}
|
||
|
private static void setJwtTokenValidator() {
|
||
|
jwtTokenValidator=new JwtTokenValidator();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 验证返回值处理
|
||
|
*/
|
||
|
public static Map<String,String> returnMsg(String status, String msg) {
|
||
|
Map<String,String> result=new HashMap<>();
|
||
|
result.put("status", status);
|
||
|
result.put("msg", msg);
|
||
|
return result;
|
||
|
}
|
||
|
}
|