春风项目四线(合箱线、总装线)
懒羊羊
2024-01-08 fd220719968cd03cf50bb43dfca021ad0d256b4e
提交 | 用户 | 时间
fd2207 1 package com.jcdm.framework.security.context;
2
3 import org.springframework.security.core.Authentication;
4
5 /**
6  * 身份验证信息
7  * 
8  * @author jc
9  */
10 public class AuthenticationContextHolder
11 {
12     private static final ThreadLocal<Authentication> contextHolder = new ThreadLocal<>();
13
14     public static Authentication getContext()
15     {
16         return contextHolder.get();
17     }
18
19     public static void setContext(Authentication context)
20     {
21         contextHolder.set(context);
22     }
23
24     public static void clearContext()
25     {
26         contextHolder.remove();
27     }
28 }