删除AI的小巧思2

This commit is contained in:
KilLze
2026-01-20 15:13:58 +08:00
parent b77952164b
commit 9c1b701594

View File

@@ -7,7 +7,6 @@ package com.bao.dating.context;
public class UserContext { public class UserContext {
private static final ThreadLocal<Long> USER_HOLDER = new ThreadLocal<>(); private static final ThreadLocal<Long> USER_HOLDER = new ThreadLocal<>();
private static final ThreadLocal<String> TOKEN_HOLDER = new ThreadLocal<>();
/** /**
* 设置当前线程的用户ID * 设置当前线程的用户ID
@@ -25,27 +24,4 @@ public class UserContext {
return USER_HOLDER.get(); return USER_HOLDER.get();
} }
/**
* 设置当前线程的token
* @param token 用户token
*/
public static void setToken(String token) {
TOKEN_HOLDER.set(token);
}
/**
* 获取当前线程的token
* @return 当前token如果未设置则返回null
*/
public static String getToken() {
return TOKEN_HOLDER.get();
}
/**
* 清除当前线程的用户ID和token
*/
public static void clear() {
USER_HOLDER.remove();
TOKEN_HOLDER.remove();
}
} }