From 780d3a3e70ab7f13e1692514913c04dd943907cf Mon Sep 17 00:00:00 2001 From: "X1627315083@163.com" <1627315083@qq.com> Date: Fri, 27 Mar 2026 11:50:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E4=B8=8D=E5=88=B0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B0=B1=E8=B7=B3=E8=BD=AC=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en.ts | 3 ++- src/lang/zh-cn.ts | 3 ++- src/views/home/agent/index.vue | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lang/en.ts b/src/lang/en.ts index 291813d..b49ec3e 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -81,7 +81,8 @@ export default { userAgreement: 'User Agreement', privacyPolicy: 'Privacy Policy', view: 'View', - remainingNum: 'Remaining number of times to upload profile picture:' + remainingNum: 'Remaining number of times to upload profile picture:', + notFound: 'Project not found', }, Country: { unitedStates: 'United States', diff --git a/src/lang/zh-cn.ts b/src/lang/zh-cn.ts index 397ef81..2c9e030 100644 --- a/src/lang/zh-cn.ts +++ b/src/lang/zh-cn.ts @@ -82,7 +82,8 @@ export default { userAgreement: '用户协议', privacyPolicy: '隐私政策', view: '查看', - remainingNum: '剩余上传头像次数:' + remainingNum: '剩余上传头像次数:', + notFound: '项目不存在', }, Country: { unitedStates: '美国', diff --git a/src/views/home/agent/index.vue b/src/views/home/agent/index.vue index f7eaa08..9ac97bb 100644 --- a/src/views/home/agent/index.vue +++ b/src/views/home/agent/index.vue @@ -36,10 +36,13 @@ import { useProjectStore } from '@/stores' import { getProjectInfo } from '@/api/agent' import { clearNodeChat, getNodeAncestors } from '@/api/versitonTree' - import { useRoute } from 'vue-router' + import { useRoute, useRouter } from 'vue-router' import MyEvent from '@/utils/myEvent' + import { useI18n } from 'vue-i18n' const route = useRoute() + const router = useRouter() + const { t } = useI18n() const projectStore = useProjectStore() const previewRef = ref(null) @@ -90,6 +93,11 @@ const handleGetProjectInfoAndHistory = () => { handleOpenSketch() getProjectInfo({ id: route.params.id }).then((res) => { + if(!res) { + router.push({ name: 'mainInput' }) + ElMessage.warning(t('Home.notFound')) + return + } if (res) agentRef.value.setChatInfo(res) let data = res?.project || res if (data?.latestNodeId) data.nodeId = data.latestNodeId