首页 > 其他分享 >【springboot】静态方法从用户协议头获取信息

【springboot】静态方法从用户协议头获取信息

时间:2022-10-25 19:35:53浏览次数:42  
标签:获取信息 静态方法 springboot request 用户 tk

 

public static Integer getUid(){
    HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    String tk = request.getHeader("Authorization");
    System.out.println(tk);
    return tk;
}

 

标签:获取信息,静态方法,springboot,request,用户,tk
From: https://www.cnblogs.com/Hello233/p/16826003.html

相关文章