feat: 调整模态框层级显示并完善跨租户访问权限控制,优化数据库字段类型定义

This commit is contained in:
wizardchen
2025-12-03 11:11:57 +08:00
parent 86e8ee0e01
commit 541e40eb75
3 changed files with 10 additions and 6 deletions
@@ -845,7 +845,7 @@ const handleCancel = () => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 1000; z-index: 1200;
backdrop-filter: blur(4px); backdrop-filter: blur(4px);
overflow: hidden; overflow: hidden;
padding: 20px; padding: 20px;
+8 -3
View File
@@ -6,6 +6,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/errors" "github.com/Tencent/WeKnora/internal/errors"
"github.com/Tencent/WeKnora/internal/logger" "github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types" "github.com/Tencent/WeKnora/internal/types"
@@ -19,6 +20,7 @@ import (
type AuthHandler struct { type AuthHandler struct {
userService interfaces.UserService userService interfaces.UserService
tenantService interfaces.TenantService tenantService interfaces.TenantService
configInfo *config.Config
} }
// NewAuthHandler creates a new auth handler instance with the provided services // NewAuthHandler creates a new auth handler instance with the provided services
@@ -27,8 +29,10 @@ type AuthHandler struct {
// - tenantService: An implementation of the TenantService interface for tenant management // - tenantService: An implementation of the TenantService interface for tenant management
// //
// Returns a pointer to the newly created AuthHandler // Returns a pointer to the newly created AuthHandler
func NewAuthHandler(userService interfaces.UserService, tenantService interfaces.TenantService) *AuthHandler { func NewAuthHandler(configInfo *config.Config,
userService interfaces.UserService, tenantService interfaces.TenantService) *AuthHandler {
return &AuthHandler{ return &AuthHandler{
configInfo: configInfo,
userService: userService, userService: userService,
tenantService: tenantService, tenantService: tenantService,
} }
@@ -241,11 +245,12 @@ func (h *AuthHandler) GetCurrentUser(c *gin.Context) {
// Don't fail the request if tenant info is not available // Don't fail the request if tenant info is not available
} }
} }
userInfo := user.ToUserInfo()
userInfo.CanAccessAllTenants = user.CanAccessAllTenants && h.configInfo.Tenant.EnableCrossTenantAccess
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": true, "success": true,
"data": gin.H{ "data": gin.H{
"user": user.ToUserInfo(), "user": userInfo,
"tenant": tenant, "tenant": tenant,
}, },
}) })
@@ -3,5 +3,4 @@
-- When enabled, the system generates questions for document chunks to improve recall -- When enabled, the system generates questions for document chunks to improve recall
ALTER TABLE knowledge_bases ALTER TABLE knowledge_bases
ADD COLUMN IF NOT EXISTS question_generation_config JSON NULL ADD COLUMN IF NOT EXISTS question_generation_config JSONB NULL ;
COMMENT 'Question generation configuration for document knowledge bases';