From 1797f5ce31111d99495551cd8d291e0157b9bc18 Mon Sep 17 00:00:00 2001 From: balibabu Date: Tue, 21 May 2024 17:37:19 +0800 Subject: [PATCH] fix: the site domain name in the Chat Bot API is hardcoded. #776 (#859) ### What problem does this PR solve? fix: the site domain name in the Chat Bot API is hardcoded. #776 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/pages/chat/chat-overview-modal/index.tsx | 4 +--- web/src/pages/chat/embed-modal/index.tsx | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/web/src/pages/chat/chat-overview-modal/index.tsx b/web/src/pages/chat/chat-overview-modal/index.tsx index 899affa96..fba7f3b42 100644 --- a/web/src/pages/chat/chat-overview-modal/index.tsx +++ b/web/src/pages/chat/chat-overview-modal/index.tsx @@ -1,5 +1,4 @@ import LineChart from '@/components/line-chart'; -import { Domain } from '@/constants/common'; import { useSetModalState, useTranslate } from '@/hooks/commonHooks'; import { IModalProps } from '@/interfaces/common'; import { IDialog, IStats } from '@/interfaces/database/chat'; @@ -81,8 +80,7 @@ const ChatOverviewModal = ({ {t('serviceApiEndpoint')} - https:// - {location.hostname === Domain ? Domain : ''} + {location.origin} /v1/api/ diff --git a/web/src/pages/chat/embed-modal/index.tsx b/web/src/pages/chat/embed-modal/index.tsx index fa9396ce0..2c2a6e390 100644 --- a/web/src/pages/chat/embed-modal/index.tsx +++ b/web/src/pages/chat/embed-modal/index.tsx @@ -1,6 +1,5 @@ import CopyToClipboard from '@/components/copy-to-clipboard'; import HightLightMarkdown from '@/components/highlight-markdown'; -import { Domain } from '@/constants/common'; import { useTranslate } from '@/hooks/commonHooks'; import { IModalProps } from '@/interfaces/common'; import { Card, Modal, Tabs, TabsProps } from 'antd'; @@ -16,7 +15,7 @@ const EmbedModal = ({ const text = ` ~~~ html