|
|
@@ -218,13 +218,14 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
// 获取聊天列表
|
|
|
const fetchChatList = async (chatMode?: 'ONLINE' | 'LOCAL') => {
|
|
|
try {
|
|
|
+ console.log('fetchChatList', chatMode);
|
|
|
let url = '';
|
|
|
if (getType() === 'bigModel') {
|
|
|
const appId = globalStore.selectedAppId;
|
|
|
if (chatMode === 'LOCAL') {
|
|
|
- url = `/bigmodel/api/dialog/list/${appId}`;
|
|
|
- } else {
|
|
|
url = `/takai/api/dialog/list/${appId}`;
|
|
|
+ } else {
|
|
|
+ url = `/bigmodel/api/dialog/list/${appId}`;
|
|
|
}
|
|
|
} else {
|
|
|
const appId = '1881269958412521255';
|
|
|
@@ -259,9 +260,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
let blob = null;
|
|
|
if (getType() === 'bigModel') {
|
|
|
if (chatMode === 'LOCAL') {
|
|
|
- blob = await api.post(`/bigmodel/api/dialog/export/${child.key}`, {}, { responseType: 'blob' });
|
|
|
- } else {
|
|
|
blob = await api.post(`/takai/api/dialog/export/${child.key}`, {}, { responseType: 'blob' });
|
|
|
+ } else {
|
|
|
+ blob = await api.post(`/bigmodel/api/dialog/export/${child.key}`, {}, { responseType: 'blob' });
|
|
|
}
|
|
|
} else {
|
|
|
blob = await api.post(`/bigmodel/api/dialog/export/${child.key}`, {}, { responseType: 'blob' });
|
|
|
@@ -283,11 +284,11 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
try {
|
|
|
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(`/bigmodel/api/dialog/del/${child.key}`);
|
|
|
@@ -332,7 +333,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
}
|
|
|
|
|
|
useEffect(() => {
|
|
|
- fetchChatList();
|
|
|
+ if (globalStore.selectedAppId) {
|
|
|
+ fetchChatList(chatStore.chatMode);
|
|
|
+ }
|
|
|
}, [globalStore.selectedAppId]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
@@ -389,9 +392,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
}
|
|
|
if (getType() === 'bigModel') {
|
|
|
if (chatStore.chatMode === 'LOCAL') {
|
|
|
- await fetchChatList();
|
|
|
- } else {
|
|
|
await fetchChatList(chatStore.chatMode);
|
|
|
+ } else {
|
|
|
+ await fetchChatList();
|
|
|
}
|
|
|
} else {
|
|
|
await fetchChatList();
|
|
|
@@ -408,9 +411,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
let url = ``;
|
|
|
if (getType() === 'bigModel') {
|
|
|
if (chatStore.chatMode === 'LOCAL') {
|
|
|
- url = `/bigmodel/api/dialog/detail/${key}`;
|
|
|
- } else {
|
|
|
url = `/takai/api/dialog/detail/${key}`;
|
|
|
+ } else {
|
|
|
+ url = `/bigmodel/api/dialog/detail/${key}`;
|
|
|
}
|
|
|
} else {
|
|
|
url = `/bigmodel/api/dialog/detail/${key}`;
|
|
|
@@ -458,17 +461,17 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
try {
|
|
|
if (getType() === 'bigModel') {
|
|
|
if (chatStore.chatMode === 'LOCAL') {
|
|
|
- await api.put(`/bigmodel/api/dialog/update`, {
|
|
|
+ await api.put(`/takai/api/dialog/update`, {
|
|
|
id: values.dialogId,
|
|
|
dialogName: values.dialogName
|
|
|
});
|
|
|
- await fetchChatList();
|
|
|
+ await fetchChatList(chatStore.chatMode);
|
|
|
} else {
|
|
|
- await api.put(`/takai/api/dialog/update`, {
|
|
|
+ await api.put(`/bigmodel/api/dialog/update`, {
|
|
|
id: values.dialogId,
|
|
|
dialogName: values.dialogName
|
|
|
});
|
|
|
- await fetchChatList(chatStore.chatMode);
|
|
|
+ await fetchChatList();
|
|
|
}
|
|
|
} else {
|
|
|
await api.put(`/bigmodel/api/dialog/update`, {
|