src/main/java/com/cl/common/context/BaseContext.java
New file @@ -0,0 +1,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(); } }