diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java index 41d14b03..ccb57282 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java @@ -87,6 +87,13 @@ public class LoginHelper { return Convert.toLong(getExtra(USER_KEY)); } + /** + * 获取用户账户 + */ + public static String getUsername() { + return Convert.toStr(getExtra(USER_NAME_KEY)); + } + /** * 获取租户ID */ @@ -130,13 +137,6 @@ public class LoginHelper { } - /** - * 获取用户账户 - */ - public static String getUsername() { - return getLoginUser().getUsername(); - } - /** * 获取用户类型 */