ny
昨天 b6f169fe43a2b13f351aefc152374fc7f0bc8cb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package jnpf.utils;
 
import jnpf.permission.entity.UserEntity;
 
 
/**
 *
 * @author JNPF开发平台组
 * @copyright 引迈信息技术有限公司
 */
public class LoginHolder {
 
 
    private static final ThreadLocal<UserEntity> USER_CACHE = new ThreadLocal<>();
 
    public static UserEntity getUserEntity(){
        return USER_CACHE.get();
    }
 
    public static void setUserEntity(UserEntity userEntity){
        USER_CACHE.set(userEntity);
    }
 
    public static void clearUserEntity(){
        USER_CACHE.remove();
    }
}