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

View File

@@ -845,7 +845,7 @@ const handleCancel = () => {
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
z-index: 1200;
backdrop-filter: blur(4px);
overflow: hidden;
padding: 20px;

View File

@@ -6,6 +6,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/errors"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
@@ -19,6 +20,7 @@ import (
type AuthHandler struct {
userService interfaces.UserService
tenantService interfaces.TenantService
configInfo *config.Config
}
// 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
//
// 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{
configInfo: configInfo,
userService: userService,
tenantService: tenantService,
}
@@ -241,11 +245,12 @@ func (h *AuthHandler) GetCurrentUser(c *gin.Context) {
// 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{
"success": true,
"data": gin.H{
"user": user.ToUserInfo(),
"user": userInfo,
"tenant": tenant,
},
})

View File

@@ -3,5 +3,4 @@
-- When enabled, the system generates questions for document chunks to improve recall
ALTER TABLE knowledge_bases
ADD COLUMN IF NOT EXISTS question_generation_config JSON NULL
COMMENT 'Question generation configuration for document knowledge bases';
ADD COLUMN IF NOT EXISTS question_generation_config JSONB NULL ;