huliguo
2 天以前 d15bb55822001421572bfee603b3d503cd63e07d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.ruoyi.errand.context;
 
import com.ruoyi.errand.domain.AppUser;
 
public class BaseContext {
 
    public static ThreadLocal<AppUser> threadLocal = new ThreadLocal<>();
 
    public static void setCurrentUser(AppUser user) {
        threadLocal.set(user);
    }
    public static AppUser getCurrentUser() {
        return threadLocal.get();
    }
 
    public static void removeCurrentPhone() {
        threadLocal.remove();
    }
 
}