微信网页登录
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.starry.admin.common.conf;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
|
||||
/**
|
||||
* @author : huchuansai
|
||||
* @since : 2024/4/2 12:10 AM
|
||||
*/
|
||||
public class ThreadLocalRequestDetail {
|
||||
private static final TransmittableThreadLocal<Object> threadLocal = new TransmittableThreadLocal<>();
|
||||
|
||||
/**
|
||||
* 设置请求信息到当前线程中
|
||||
*/
|
||||
public static void setRequestDetail(Object data) {
|
||||
threadLocal.set(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从当前线程中获取请求信息
|
||||
*/
|
||||
public static Object getRequestDetail() {
|
||||
return threadLocal.get();
|
||||
}
|
||||
|
||||
public static PlayClerkUserInfoEntity getClerkUserInfo() {
|
||||
return (PlayClerkUserInfoEntity) threadLocal.get();
|
||||
}
|
||||
|
||||
public static PlayCustomUserInfoEntity getCustomUserInfo() {
|
||||
return (PlayCustomUserInfoEntity) threadLocal.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁
|
||||
*/
|
||||
public static void remove() {
|
||||
threadLocal.remove();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user