|
|
@@ -221,14 +221,10 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
let url = '';
|
|
|
if (getType() === 'bigModel') {
|
|
|
const appId = globalStore.selectedAppId;
|
|
|
- if (chatMode) {
|
|
|
- if (chatMode === 'LOCAL') {
|
|
|
- url = `/bigmodel/api/dialog/list/${appId}`;
|
|
|
- } else {
|
|
|
- url = `/takai/api/dialog/list/${appId}`;
|
|
|
- }
|
|
|
- } else {
|
|
|
+ if (chatMode === 'LOCAL') {
|
|
|
url = `/bigmodel/api/dialog/list/${appId}`;
|
|
|
+ } else {
|
|
|
+ url = `/takai/api/dialog/list/${appId}`;
|
|
|
}
|
|
|
} else {
|
|
|
const appId = '1881269958412521255';
|
|
|
@@ -276,12 +272,17 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
label: (
|
|
|
<a onClick={async () => {
|
|
|
try {
|
|
|
- if (chatMode === 'LOCAL') {
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
+ if (chatMode === 'LOCAL') {
|
|
|
+ await api.delete(`/bigmodel/api/dialog/del/${child.key}`);
|
|
|
+ await fetchChatList();
|
|
|
+ } else {
|
|
|
+ await api.delete(`/takai/api/dialog/del/${child.key}`);
|
|
|
+ await fetchChatList(chatMode);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
await api.delete(`/bigmodel/api/dialog/del/${child.key}`);
|
|
|
await fetchChatList();
|
|
|
- } else {
|
|
|
- await api.delete(`/takai/api/dialog/del/${child.key}`);
|
|
|
- await fetchChatList(chatMode);
|
|
|
}
|
|
|
chatStore.clearSessions();
|
|
|
useChatStore.setState({
|
|
|
@@ -377,10 +378,14 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
} else {
|
|
|
navigate({ pathname: '/newDeepseekChat' });
|
|
|
}
|
|
|
- if (chatStore.chatMode === 'LOCAL') {
|
|
|
- await fetchChatList();
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
+ if (chatStore.chatMode === 'LOCAL') {
|
|
|
+ await fetchChatList();
|
|
|
+ } else {
|
|
|
+ await fetchChatList(chatStore.chatMode);
|
|
|
+ }
|
|
|
} else {
|
|
|
- await fetchChatList(chatStore.chatMode);
|
|
|
+ await fetchChatList();
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
|
@@ -392,10 +397,14 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
style={{ border: 'none' }}
|
|
|
onClick={async ({ key }) => {
|
|
|
let url = ``;
|
|
|
- if (chatStore.chatMode === 'LOCAL') {
|
|
|
- url = `/bigmodel/api/dialog/detail/${key}`;
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
+ if (chatStore.chatMode === 'LOCAL') {
|
|
|
+ url = `/bigmodel/api/dialog/detail/${key}`;
|
|
|
+ } else {
|
|
|
+ url = `/takai/api/dialog/detail/${key}`;
|
|
|
+ }
|
|
|
} else {
|
|
|
- url = `/takai/api/dialog/detail/${key}`;
|
|
|
+ url = `/bigmodel/api/dialog/detail/${key}`;
|
|
|
}
|
|
|
const res = await api.get(url);
|
|
|
const list = res.data.map(((item: any) => {
|
|
|
@@ -438,18 +447,26 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
form.validateFields().then(async (values) => {
|
|
|
setModalOpen(false);
|
|
|
try {
|
|
|
- if (chatStore.chatMode === 'LOCAL') {
|
|
|
+ if (getType() === 'bigModel') {
|
|
|
+ if (chatStore.chatMode === 'LOCAL') {
|
|
|
+ await api.put(`/bigmodel/api/dialog/update`, {
|
|
|
+ id: values.dialogId,
|
|
|
+ dialogName: values.dialogName
|
|
|
+ });
|
|
|
+ await fetchChatList();
|
|
|
+ } else {
|
|
|
+ await api.put(`/takai/api/dialog/update`, {
|
|
|
+ id: values.dialogId,
|
|
|
+ dialogName: values.dialogName
|
|
|
+ });
|
|
|
+ await fetchChatList(chatStore.chatMode);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
await api.put(`/bigmodel/api/dialog/update`, {
|
|
|
id: values.dialogId,
|
|
|
dialogName: values.dialogName
|
|
|
});
|
|
|
await fetchChatList();
|
|
|
- } else {
|
|
|
- await api.put(`/takai/api/dialog/update`, {
|
|
|
- id: values.dialogId,
|
|
|
- dialogName: values.dialogName
|
|
|
- });
|
|
|
- await fetchChatList(chatStore.chatMode);
|
|
|
}
|
|
|
chatStore.updateCurrentSession((value) => {
|
|
|
value.topic = values.dialogName;
|