From 1a30b7c0daaf643ce33c847b91131de512a38cc6 Mon Sep 17 00:00:00 2001 From: caojianbin <1910336823> Date: Thu, 22 Sep 2022 11:01:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E5=8F=91APP=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/core/context/SecurityContextHolder.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/context/SecurityContextHolder.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/context/SecurityContextHolder.java index ef20081..6c1357f 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/context/SecurityContextHolder.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/context/SecurityContextHolder.java @@ -77,6 +77,15 @@ public class SecurityContextHolder set(SecurityConstants.DETAILS_USERNAME, username); } + public static void setUserAgent(String userId,String useragent) + { + set("userId", useragent); + } + public static String getUserAgent(String userId) + { + return get(userId); + } + public static String getUserKey() { return get(SecurityConstants.USER_KEY);