From 541e40eb7542498a772be5f362df0c575747cd69 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 3 Dec 2025 11:11:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E6=A8=A1=E6=80=81?= =?UTF-8?q?=E6=A1=86=E5=B1=82=E7=BA=A7=E6=98=BE=E7=A4=BA=E5=B9=B6=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E8=B7=A8=E7=A7=9F=E6=88=B7=E8=AE=BF=E9=97=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A7=E5=88=B6=EF=BC=8C=E4=BC=98=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ModelEditorDialog.vue | 2 +- internal/handler/auth.go | 11 ++++++++--- .../000017_add_question_generation_config.up.sql | 3 +-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/ModelEditorDialog.vue b/frontend/src/components/ModelEditorDialog.vue index 4db174b2a..5cde40fb6 100644 --- a/frontend/src/components/ModelEditorDialog.vue +++ b/frontend/src/components/ModelEditorDialog.vue @@ -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; diff --git a/internal/handler/auth.go b/internal/handler/auth.go index 0fca719be..b9908e02f 100644 --- a/internal/handler/auth.go +++ b/internal/handler/auth.go @@ -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, }, }) diff --git a/migrations/versioned/000017_add_question_generation_config.up.sql b/migrations/versioned/000017_add_question_generation_config.up.sql index 7b9c483ac..67a55d52a 100644 --- a/migrations/versioned/000017_add_question_generation_config.up.sql +++ b/migrations/versioned/000017_add_question_generation_config.up.sql @@ -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 ;