Skip to content

Commit 2ad2351

Browse files
committed
refactor:UserContextHolder ThreadLocal => TransmittableThreadLocal
1 parent 8bcf27c commit 2ad2351

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

continew-common/src/main/java/top/continew/admin/common/context/UserContextHolder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import cn.dev33.satoken.stp.StpUtil;
2121
import cn.hutool.core.convert.Convert;
2222
import cn.hutool.extra.spring.SpringUtil;
23+
import com.alibaba.ttl.TransmittableThreadLocal;
2324
import top.continew.admin.common.api.system.UserApi;
2425
import top.continew.starter.core.util.ExceptionUtils;
2526

@@ -31,8 +32,8 @@
3132
*/
3233
public class UserContextHolder {
3334

34-
private static final ThreadLocal<UserContext> CONTEXT_HOLDER = new ThreadLocal<>();
35-
private static final ThreadLocal<UserExtraContext> EXTRA_CONTEXT_HOLDER = new ThreadLocal<>();
35+
private static final TransmittableThreadLocal<UserContext> CONTEXT_HOLDER = new TransmittableThreadLocal<>();
36+
private static final TransmittableThreadLocal<UserExtraContext> EXTRA_CONTEXT_HOLDER = new TransmittableThreadLocal<>();
3637

3738
private UserContextHolder() {
3839
}

0 commit comments

Comments
 (0)