智能体跳转切换优化

This commit is contained in:
runny committed 2026-06-03 10:43:18 +08:00
1 parent 1f96d6fccc
commit 55ce8dd949
3 files changed
+91 -52

No files matched your search

+6 -9
View File
@@ -28,7 +28,6 @@ import {
} from '../utils/wecom';
import { getAuthHeaders, getStoredAuthUser, saveAuthUser, logoutAuth } from '../utils/auth';
import { getLastChatAgentId } from '../utils/lastChatAgent';
import { openAgentChatTab } from '../utils/agentTabs';
import {
Settings,
LayoutGrid,
@@ -1113,8 +1112,7 @@ const navigateToChat = (id: number) => {
msg.warning(t('login.loginRequired'));
return;
}
const url = router.resolve(`/chat/${id}`).href;
openAgentChatTab(url, id);
router.push(`/chat/${id}`);
};
const navigateWithQuickQuestion = (agentId: number, question: string) => {
@@ -1123,11 +1121,10 @@ const navigateWithQuickQuestion = (agentId: number, question: string) => {
msg.warning(t('login.loginRequired'));
return;
}
const url = router.resolve({
router.push({
path: `/chat/${agentId}`,
query: { preset: question },
}).href;
openAgentChatTab(url, agentId);
});
};
const handleWecomDeeplinkContext = async () => {
@@ -1156,11 +1153,11 @@ const handleWecomDeeplinkContext = async () => {
if (target === 'chat' && agentIdRaw && isLoggedIn.value) {
const agentId = Number(agentIdRaw);
if (Number.isInteger(agentId) && agents.value.some((a) => a.id === agentId)) {
const url = router.resolve({
await router.push({
path: `/chat/${agentId}`,
query: preset ? { preset } : {},
}).href;
openAgentChatTab(url, agentId);
});
return;
}
}