huliguo
2025-05-13 a70919b4f7baab856125f36e5bd41f5ee81be680
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.cl.common.context;
 
import com.cl.pojo.entity.User;
 
import java.util.Map;
 
public class BaseContext {
 
    public static ThreadLocal<User> threadLocal = new ThreadLocal<>();
 
    public static void setCurrentUser(User user) {
        threadLocal.set(user);
    }
    public static User getCurrentUser() {
        return threadLocal.get();
    }
 
    public static void removeCurrentPhone() {
        threadLocal.remove();
    }
 
}