wu
2024-06-26 c59cbfa92147058b828f78ed35b15d4ef4a7ef94
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();
        }
    }
}