wang
2024-05-09 93e36c526fe445c14d5fb19f3653f8a8e55e3a6c
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
package com.mes.common.utils;
 
import com.mes.userinfo.entity.SysUser;
 
/**
 * @Author : zhoush
 * @Date: 2024/4/25 15:41
 * @Description:
 */
public class UserInfoUtils {
    private static InheritableThreadLocal<SysUser> tokenPool = new InheritableThreadLocal<SysUser>();
 
    public static SysUser get() {
        return tokenPool.get();
    }
 
    public static void set(SysUser user) {
        tokenPool.set(user);
    }
 
    public static void remove() {
        if (get() != null) {
            tokenPool.remove();
        }
    }
}