【fix sonar】UserTokenContext文件
This commit is contained in:
+7
-2
@@ -7,11 +7,12 @@ package com.jero.common.config.mqtoken;
|
|||||||
*/
|
*/
|
||||||
public class UserTokenContext {
|
public class UserTokenContext {
|
||||||
|
|
||||||
private static ThreadLocal<String> userToken = new ThreadLocal<String>();
|
private UserTokenContext(){
|
||||||
|
|
||||||
public UserTokenContext() {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ThreadLocal<String> userToken = new ThreadLocal<>();
|
||||||
|
|
||||||
public static String getToken(){
|
public static String getToken(){
|
||||||
return userToken.get();
|
return userToken.get();
|
||||||
}
|
}
|
||||||
@@ -19,4 +20,8 @@ public class UserTokenContext {
|
|||||||
public static void setToken(String token){
|
public static void setToken(String token){
|
||||||
userToken.set(token);
|
userToken.set(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void delToken(){
|
||||||
|
userToken.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user