From 836eba60214329dcf44672477dd0a0efead81a02 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 06 五月 2026 16:26:35 +0800
Subject: [PATCH] config(demo): 更新演示环境配置文件
---
src/main/java/com/ruoyi/framework/security/LoginUser.java | 132 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 110 insertions(+), 22 deletions(-)
diff --git a/src/main/java/com/ruoyi/framework/security/LoginUser.java b/src/main/java/com/ruoyi/framework/security/LoginUser.java
index 93afdff..330ae43 100644
--- a/src/main/java/com/ruoyi/framework/security/LoginUser.java
+++ b/src/main/java/com/ruoyi/framework/security/LoginUser.java
@@ -24,7 +24,7 @@
/**
* 閮ㄩ棬ID
*/
- private Long deptId;
+ private Long [] deptIds;
/**
* 鐢ㄦ埛鍞竴鏍囪瘑
@@ -71,23 +71,63 @@
*/
private SysUser user;
+ /**
+ * 绉熸埛ID
+ */
+ private Long tenantId;
+
+ /**
+ * 褰撳墠閮ㄩ棬id
+ */
+ private Long currentDeptId;
+
+ /**
+ * 鏄惁寮�閫欰I鍔熻兘锛�0鍚� 1鏄級
+ */
+ private Integer aiEnabled;
+
+ private String dataScope;
+
public LoginUser()
{
}
- public LoginUser(SysUser user, Set<String> permissions)
- {
- this.user = user;
- this.permissions = permissions;
- }
+ public LoginUser(SysUser user, Set<String> permissions)
+ {
+ this.user = user;
+ this.permissions = permissions;
+ this.aiEnabled = user == null ? null : user.getAiEnabled();
+ }
- public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
- {
- this.userId = userId;
- this.deptId = deptId;
- this.user = user;
- this.permissions = permissions;
- }
+ public LoginUser(Long userId, Long [] deptId, SysUser user, Set<String> permissions)
+ {
+ this.userId = userId;
+ this.deptIds = deptId;
+ this.user = user;
+ this.permissions = permissions;
+ this.aiEnabled = user == null ? null : user.getAiEnabled();
+ }
+
+ public LoginUser(Long userId, Long [] deptIds, SysUser user,Long tenantId, Set<String> permissions)
+ {
+ this.userId = userId;
+ this.deptIds = deptIds;
+ this.user = user;
+ this.permissions = permissions;
+ this.tenantId = tenantId;
+ this.aiEnabled = user == null ? null : user.getAiEnabled();
+ }
+
+ public LoginUser(Long userId, Long [] deptIds, SysUser user,Long tenantId,Long currentDeptId, Set<String> permissions)
+ {
+ this.userId = userId;
+ this.deptIds = deptIds;
+ this.user = user;
+ this.permissions = permissions;
+ this.tenantId = tenantId;
+ this.currentDeptId = currentDeptId;
+ this.aiEnabled = user == null ? null : user.getAiEnabled();
+ }
public Long getUserId()
{
@@ -99,14 +139,14 @@
this.userId = userId;
}
- public Long getDeptId()
+ public Long [] getDeptIds()
{
- return deptId;
+ return deptIds;
}
- public void setDeptId(Long deptId)
+ public void setDeptId(Long [] deptIds)
{
- this.deptId = deptId;
+ this.deptIds = deptIds;
}
public String getToken()
@@ -130,6 +170,11 @@
public String getUsername()
{
return user.getUserName();
+ }
+
+ public String getNickName()
+ {
+ return user.getNickName();
}
/**
@@ -253,14 +298,57 @@
return user;
}
- public void setUser(SysUser user)
- {
- this.user = user;
- }
+ public void setUser(SysUser user)
+ {
+ this.user = user;
+ this.aiEnabled = user == null ? null : user.getAiEnabled();
+ }
@Override
public Collection<? extends GrantedAuthority> getAuthorities()
{
return null;
}
-}
+
+ public Long getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(Long tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public void setDeptIds(Long[] deptIds) {
+ this.deptIds = deptIds;
+ }
+
+ public Long getCurrentDeptId() {
+ return currentDeptId;
+ }
+
+ public void setCurrentDeptId(Long currentDeptId) {
+ this.currentDeptId = currentDeptId;
+ }
+
+ public Integer getAiEnabled() {
+ if (aiEnabled != null) {
+ return aiEnabled;
+ }
+ if (user != null && user.getAiEnabled() != null) {
+ return user.getAiEnabled();
+ }
+ return 0;
+ }
+
+ public void setAiEnabled(Integer aiEnabled) {
+ this.aiEnabled = aiEnabled;
+ }
+
+ public String getDataScope() {
+ return dataScope;
+ }
+
+ public void setDataScope(String dataScope) {
+ this.dataScope = dataScope;
+ }
+}
--
Gitblit v1.9.3