|
|
@@ -1017,11 +1017,12 @@ function _Chat() {
|
|
|
const [selectedFruit, setSelectedFruit] = React.useState(chatStore.chatMode);
|
|
|
|
|
|
// 获取应用列表
|
|
|
- const fetchApplicationList = async () => {
|
|
|
+ const fetchApplicationList = async (chatMode?: string) => {
|
|
|
+ let mode = chatMode || selectedFruit;
|
|
|
setLoading(true);
|
|
|
try {
|
|
|
let url = null;
|
|
|
- if (selectedFruit === 'LOCAL') {
|
|
|
+ if (mode === 'LOCAL') {
|
|
|
url = '/deepseek/api/application/list';
|
|
|
} else {
|
|
|
url = '/bigmodel/api/application/list';
|
|
|
@@ -1068,8 +1069,8 @@ function _Chat() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const init = async () => {
|
|
|
- await fetchApplicationList();
|
|
|
+ const init = async (chatMode?: string) => {
|
|
|
+ await fetchApplicationList(chatMode);
|
|
|
}
|
|
|
|
|
|
useEffect(() => {
|
|
|
@@ -1096,7 +1097,7 @@ function _Chat() {
|
|
|
session.appId = appId;
|
|
|
});
|
|
|
}
|
|
|
- init();
|
|
|
+ init(chatMode);
|
|
|
}
|
|
|
}, [])
|
|
|
|
|
|
@@ -1600,7 +1601,15 @@ function _Chat() {
|
|
|
}
|
|
|
|
|
|
const getAppName = () => {
|
|
|
- const appId = globalStore.selectedAppId;
|
|
|
+ const search = location.search;
|
|
|
+ const params = new URLSearchParams(search);
|
|
|
+ const chatMode = params.get('chatMode');
|
|
|
+ let appId = '';
|
|
|
+ if (chatMode) {
|
|
|
+ appId = globalStore.selectedAppId;
|
|
|
+ } else {
|
|
|
+ appId = appValue as string;
|
|
|
+ }
|
|
|
const item = appList.find(item => item.value === appId);
|
|
|
if (!item) {
|
|
|
return '';
|
|
|
@@ -1609,7 +1618,15 @@ function _Chat() {
|
|
|
}
|
|
|
|
|
|
const getDesc = () => {
|
|
|
- const appId = globalStore.selectedAppId;
|
|
|
+ const search = location.search;
|
|
|
+ const params = new URLSearchParams(search);
|
|
|
+ const chatMode = params.get('chatMode');
|
|
|
+ let appId = '';
|
|
|
+ if (chatMode) {
|
|
|
+ appId = globalStore.selectedAppId;
|
|
|
+ } else {
|
|
|
+ appId = appValue as string;
|
|
|
+ }
|
|
|
const item = appList.find(item => item.value === appId);
|
|
|
if (!item) {
|
|
|
return '';
|