From 7fff9a9e14e06568933afa9af5168ffa9cdb3de9 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期二, 23 九月 2025 17:58:29 +0800
Subject: [PATCH] yys 修改巡检bug
---
src/main/java/com/ruoyi/framework/security/LoginUser.java | 112 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 83 insertions(+), 29 deletions(-)
diff --git a/src/main/java/com/ruoyi/framework/security/LoginUser.java b/src/main/java/com/ruoyi/framework/security/LoginUser.java
index 0e23a10..bb91be1 100644
--- a/src/main/java/com/ruoyi/framework/security/LoginUser.java
+++ b/src/main/java/com/ruoyi/framework/security/LoginUser.java
@@ -4,7 +4,7 @@
import java.util.Set;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
-import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.alibaba.fastjson2.annotation.JSONField;
import com.ruoyi.project.system.domain.SysUser;
/**
@@ -24,7 +24,7 @@
/**
* 閮ㄩ棬ID
*/
- private Long deptId;
+ private Long [] deptIds;
/**
* 鐢ㄦ埛鍞竴鏍囪瘑
@@ -71,6 +71,53 @@
*/
private SysUser user;
+ /**
+ * 绉熸埛ID
+ */
+ private Long tenantId;
+
+ /**
+ * 褰撳墠閮ㄩ棬id
+ */
+ private Long currentDeptId;
+
+ public LoginUser()
+ {
+ }
+
+ public LoginUser(SysUser user, Set<String> permissions)
+ {
+ 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;
+ }
+
+ 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;
+ }
+
+ 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;
+ }
+
public Long getUserId()
{
return userId;
@@ -81,14 +128,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()
@@ -101,25 +148,7 @@
this.token = token;
}
- public LoginUser()
- {
- }
-
- public LoginUser(SysUser user, Set<String> permissions)
- {
- this.user = user;
- this.permissions = permissions;
- }
-
- public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
- {
- this.userId = userId;
- this.deptId = deptId;
- this.user = user;
- this.permissions = permissions;
- }
-
- @JsonIgnore
+ @JSONField(serialize = false)
@Override
public String getPassword()
{
@@ -132,10 +161,15 @@
return user.getUserName();
}
+ public String getNickName()
+ {
+ return user.getNickName();
+ }
+
/**
* 璐︽埛鏄惁鏈繃鏈�,杩囨湡鏃犳硶楠岃瘉
*/
- @JsonIgnore
+ @JSONField(serialize = false)
@Override
public boolean isAccountNonExpired()
{
@@ -147,7 +181,7 @@
*
* @return
*/
- @JsonIgnore
+ @JSONField(serialize = false)
@Override
public boolean isAccountNonLocked()
{
@@ -159,7 +193,7 @@
*
* @return
*/
- @JsonIgnore
+ @JSONField(serialize = false)
@Override
public boolean isCredentialsNonExpired()
{
@@ -171,7 +205,7 @@
*
* @return
*/
- @JsonIgnore
+ @JSONField(serialize = false)
@Override
public boolean isEnabled()
{
@@ -263,4 +297,24 @@
{
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;
+ }
}
--
Gitblit v1.9.3