From 2382a47279b6ed520593539f73aa5e512b4f016e Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期二, 03 六月 2025 11:31:55 +0800
Subject: [PATCH] 用户绑定多公司

---
 src/main/java/com/ruoyi/framework/security/LoginUser.java |   86 +++++++++++++++++++++++++++----------------
 1 files changed, 54 insertions(+), 32 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/security/LoginUser.java b/src/main/java/com/ruoyi/framework/security/LoginUser.java
index fd42c5c..c1ce6ab 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,35 +71,10 @@
      */
     private SysUser user;
 
-    public Long getUserId()
-    {
-        return userId;
-    }
-
-    public void setUserId(Long userId)
-    {
-        this.userId = userId;
-    }
-
-    public Long getDeptId()
-    {
-        return deptId;
-    }
-
-    public void setDeptId(Long deptId)
-    {
-        this.deptId = deptId;
-    }
-
-    public String getToken()
-    {
-        return token;
-    }
-
-    public void setToken(String token)
-    {
-        this.token = token;
-    }
+    /**
+     * 绉熸埛ID
+     */
+    private Integer tenantId;
 
     public LoginUser()
     {
@@ -111,12 +86,51 @@
         this.permissions = permissions;
     }
 
-    public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
+    public LoginUser(Long userId, Long [] deptId, SysUser user, Set<String> permissions)
     {
         this.userId = userId;
-        this.deptId = deptId;
+        this.deptIds = deptId;
         this.user = user;
         this.permissions = permissions;
+    }
+
+    public LoginUser(Long userId, Long [] deptIds, SysUser user,Integer tenantId, Set<String> permissions)
+    {
+        this.userId = userId;
+        this.deptIds = deptIds;
+        this.user = user;
+        this.permissions = permissions;
+        this.tenantId = tenantId;
+    }
+
+    public Long getUserId()
+    {
+        return userId;
+    }
+
+    public void setUserId(Long userId)
+    {
+        this.userId = userId;
+    }
+
+    public Long [] getDeptIds()
+    {
+        return deptIds;
+    }
+
+    public void setDeptId(Long [] deptIds)
+    {
+        this.deptIds = deptIds;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+
+    public void setToken(String token)
+    {
+        this.token = token;
     }
 
     @JSONField(serialize = false)
@@ -263,4 +277,12 @@
     {
         return null;
     }
+
+    public Integer getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Integer tenantId) {
+        this.tenantId = tenantId;
+    }
 }

--
Gitblit v1.9.3