|
|
@@ -2,6 +2,7 @@ import React, { useEffect, useRef, useMemo, useState, Fragment } from "react";
|
|
|
import styles from "./home.module.scss";
|
|
|
import DragIcon from "../icons/drag.svg";
|
|
|
import faviconSrc from "../icons/favicon.png";
|
|
|
+import deepSeekSrc from "../icons/deepSeek.png";
|
|
|
import { EditOutlined } from '@ant-design/icons';
|
|
|
import { useAppConfig, useChatStore, useGlobalStore } from "../store";
|
|
|
import {
|
|
|
@@ -205,13 +206,23 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
const [modalOpen, setModalOpen] = useState(false)
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
+ const getType = (): 'bigModel' | 'deepSeek' => {
|
|
|
+ if (['/knowledgeChat', '/newChat'].includes(location.pathname)) {
|
|
|
+ return 'bigModel';
|
|
|
+ } else if (['/deepseekChat', '/newDeepseekChat'].includes(location.pathname)) {
|
|
|
+ return 'deepSeek';
|
|
|
+ } else {
|
|
|
+ return 'bigModel';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 获取聊天列表
|
|
|
const fetchChatList = async () => {
|
|
|
try {
|
|
|
let appId = '';
|
|
|
- if (['/knowledgeChat', '/newChat'].includes(location.pathname)) {
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
appId = globalStore.selectedAppId;
|
|
|
- } else if (['/deepseekChat', '/newDeepseekChat'].includes(location.pathname)) {
|
|
|
+ } else {
|
|
|
appId = '1881269958412521255';
|
|
|
}
|
|
|
const res = await api.get(`/bigmodel/api/dialog/list/${appId}`);
|
|
|
@@ -307,9 +318,15 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
shouldNarrow={shouldNarrow}
|
|
|
{...props}
|
|
|
>
|
|
|
+ {
|
|
|
+ getType() === 'deepSeek' &&
|
|
|
+ <div>
|
|
|
+ <img style={{ width: '100%' }} src={deepSeekSrc.src} />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
<SideBarHeader
|
|
|
- title="问答历史"
|
|
|
- logo={<img style={{ height: 40, cursor: 'pointer' }} src={faviconSrc.src} />}
|
|
|
+ title={getType() === 'bigModel' ? '问答历史' : ''}
|
|
|
+ logo={getType() === 'bigModel' ? <img style={{ height: 40 }} src={faviconSrc.src} /> : ''}
|
|
|
>
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 10 }}>
|
|
|
<Button
|
|
|
@@ -328,9 +345,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
chatStore.updateCurrentSession((value) => {
|
|
|
value.appId = globalStore.selectedAppId;
|
|
|
});
|
|
|
- if (['/knowledgeChat', '/newChat'].includes(location.pathname)) {
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
navigate({ pathname: '/newChat' });
|
|
|
- } else if (['/deepseekChat', '/newDeepseekChat'].includes(location.pathname)) {
|
|
|
+ } else {
|
|
|
navigate({ pathname: '/newDeepseekChat' });
|
|
|
}
|
|
|
await fetchChatList()
|
|
|
@@ -366,9 +383,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
value.id = session.id;
|
|
|
value.messages = list;
|
|
|
});
|
|
|
- if (['/knowledgeChat', '/newChat'].includes(location.pathname)) {
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
navigate({ pathname: '/newChat' });
|
|
|
- } else if (['/deepseekChat', '/newDeepseekChat'].includes(location.pathname)) {
|
|
|
+ } else {
|
|
|
navigate({ pathname: '/newDeepseekChat' });
|
|
|
}
|
|
|
}}
|