diff --git a/web/src/assets/svg/file-icon/md.svg b/web/src/assets/svg/file-icon/md.svg new file mode 100644 index 0000000000..087bc00f04 --- /dev/null +++ b/web/src/assets/svg/file-icon/md.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/web/src/hooks/logic-hooks.ts b/web/src/hooks/logic-hooks.ts index 15fea62464..a3c71fda82 100644 --- a/web/src/hooks/logic-hooks.ts +++ b/web/src/hooks/logic-hooks.ts @@ -10,7 +10,7 @@ import { IClientConversation, IMessage } from '@/pages/chat/interface'; import api from '@/utils/api'; import { getAuthorization } from '@/utils/authorization-util'; import { buildMessageUuid, getMessagePureId } from '@/utils/chat'; -import { PaginationProps } from 'antd'; +import { PaginationProps, message } from 'antd'; import { FormInstance } from 'antd/lib'; import axios from 'axios'; import { EventSourceParserStream } from 'eventsource-parser/stream'; @@ -280,8 +280,8 @@ export const useSendMessageWithSse = ( export const useSpeechWithSse = (url: string = api.tts) => { const read = useCallback( - (body: any) => { - const response = fetch(url, { + async (body: any) => { + const response = await fetch(url, { method: 'POST', headers: { [Authorization]: getAuthorization(), @@ -289,6 +289,14 @@ export const useSpeechWithSse = (url: string = api.tts) => { }, body: JSON.stringify(body), }); + try { + const res = await response.clone().json(); + if (res?.retcode !== 0) { + message.error(res?.retmsg); + } + } catch (error) { + console.warn('🚀 ~ error:', error); + } return response; }, [url], diff --git a/web/src/layouts/components/header/index.tsx b/web/src/layouts/components/header/index.tsx index 9729ba1874..694840547b 100644 --- a/web/src/layouts/components/header/index.tsx +++ b/web/src/layouts/components/header/index.tsx @@ -9,7 +9,7 @@ import { useLocation } from 'umi'; import Toolbar from '../right-toolbar'; import { useFetchAppConf } from '@/hooks/logic-hooks'; -import { MessageOutlined, SearchOutlined } from '@ant-design/icons'; +import { MessageOutlined } from '@ant-design/icons'; import styles from './index.less'; const { Header } = Layout; @@ -27,7 +27,7 @@ const RagHeader = () => { () => [ { path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon }, { path: '/chat', name: t('chat'), icon: MessageOutlined }, - { path: '/search', name: t('search'), icon: SearchOutlined }, + // { path: '/search', name: t('search'), icon: SearchOutlined }, { path: '/flow', name: t('flow'), icon: GraphIcon }, { path: '/file', name: t('fileManager'), icon: FileIcon }, ],