huliguo
2 天以前 5d7b65670282a4fad015e37d567cfa171b162052
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();
    }
 
}