liyong
13 小时以前 1ca5584d7e3200a9af65a099bd26d3593e2ba702
src/main/java/com/ruoyi/framework/security/LoginUser.java
@@ -81,6 +81,13 @@
     */
    private Long currentDeptId;
    /**
     * 是否开通AI功能(0否 1是)
     */
    private Integer aiEnabled;
    private String dataScope;
    public LoginUser()
    {
    }
@@ -89,6 +96,7 @@
    {
        this.user = user;
        this.permissions = permissions;
        this.aiEnabled = user == null ? null : user.getAiEnabled();
    }
    public LoginUser(Long userId, Long [] deptId, SysUser user, Set<String> permissions)
@@ -97,6 +105,7 @@
        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)
@@ -106,6 +115,7 @@
        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)
@@ -116,6 +126,7 @@
        this.permissions = permissions;
        this.tenantId = tenantId;
        this.currentDeptId = currentDeptId;
        this.aiEnabled = user == null ? null : user.getAiEnabled();
    }
    public Long getUserId()
@@ -290,6 +301,7 @@
    public void setUser(SysUser user)
    {
        this.user = user;
        this.aiEnabled = user == null ? null : user.getAiEnabled();
    }
    @Override
@@ -317,4 +329,26 @@
    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;
    }
}