From 1c60dce3f16000abd2480d1f56d937a1ff74ea66 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 12 Jul 2024 18:51:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20Ai?= =?UTF-8?q?=E5=8A=A9=E6=89=8B=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/desktop/V2.9__ddl.sql | 2 ++ .../main/resources/db/migration/V2.9__ddl.sql | 2 ++ .../src/layout/components/Header.vue | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql b/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql index 6a8724cabf..0a32227095 100644 --- a/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql +++ b/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql @@ -46,3 +46,5 @@ CREATE TABLE `core_copilot_config` ( INSERT INTO `core_copilot_config` VALUES (1, 'https://copilot-demo.test.fit2cloud.dev:5000', 'xlab', 'Q2Fsb25nQDIwMTU='); +UPDATE `core_sys_setting` SET `pkey` = 'ai.baseUrl', `pval` = 'https://maxkb.fit2cloud.com/ui/chat/2ddd8b594ce09dbb?mode=embed', `type` = 'text', `sort` = 0 WHERE `id` = 3; + diff --git a/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql index 6a8724cabf..0a32227095 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql @@ -46,3 +46,5 @@ CREATE TABLE `core_copilot_config` ( INSERT INTO `core_copilot_config` VALUES (1, 'https://copilot-demo.test.fit2cloud.dev:5000', 'xlab', 'Q2Fsb25nQDIwMTU='); +UPDATE `core_sys_setting` SET `pkey` = 'ai.baseUrl', `pval` = 'https://maxkb.fit2cloud.com/ui/chat/2ddd8b594ce09dbb?mode=embed', `type` = 'text', `sort` = 0 WHERE `id` = 3; + diff --git a/core/core-frontend/src/layout/components/Header.vue b/core/core-frontend/src/layout/components/Header.vue index 1e4ead91b0..d22a372c10 100644 --- a/core/core-frontend/src/layout/components/Header.vue +++ b/core/core-frontend/src/layout/components/Header.vue @@ -26,7 +26,7 @@ const { push } = useRouter() const route = useRoute() import { useCache } from '@/hooks/web/useCache' const { wsCache } = useCache('localStorage') -const aiBaseUrl = ref(null) +const aiBaseUrl = ref('https://maxkb.fit2cloud.com/ui/chat/2ddd8b594ce09dbb?mode=embed') const handleIconClick = () => { if (route.path === '/workbranch/index') return push('/workbranch/index') @@ -56,7 +56,7 @@ const downloadClick = params => { const routers: any[] = formatRoute(permissionStore.getRoutersNotHidden as AppCustomRouteRecordRaw[]) const showSystem = ref(false) const showToolbox = ref(false) -const showOverlay = ref(true) +const showOverlay = ref(false) const showOverlayCopilot = ref(true) const handleSelect = (index: string) => { // 自定义事件 @@ -76,16 +76,18 @@ const navigateBg = computed(() => appearanceStore.getNavigateBg) const navigate = computed(() => appearanceStore.getNavigate) const initAiBase = async () => { - const aiTipsCheck = wsCache.get('DE-AI-TIPS-CHECK') - if (aiTipsCheck === 'CHECKED') { - showOverlay.value = false - } else { - showOverlay.value = true - } + // const aiTipsCheck = wsCache.get('DE-AI-TIPS-CHECK') + // if (aiTipsCheck === 'CHECKED') { + // showOverlay.value = false + // } else { + // showOverlay.value = true + // } await findBaseParams().then(rsp => { const params = rsp.data if (params && params['ai.baseUrl']) { aiBaseUrl.value = params['ai.baseUrl'] + } else { + aiBaseUrl.value = null } }) }