查不到项目就跳转创建项目页面

This commit is contained in:
X1627315083@163.com
2026-03-27 11:50:13 +08:00
parent 185a041962
commit 780d3a3e70
3 changed files with 13 additions and 3 deletions

View File

@@ -81,7 +81,8 @@ export default {
userAgreement: 'User Agreement', userAgreement: 'User Agreement',
privacyPolicy: 'Privacy Policy', privacyPolicy: 'Privacy Policy',
view: 'View', 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: { Country: {
unitedStates: 'United States', unitedStates: 'United States',

View File

@@ -82,7 +82,8 @@ export default {
userAgreement: '用户协议', userAgreement: '用户协议',
privacyPolicy: '隐私政策', privacyPolicy: '隐私政策',
view: '查看', view: '查看',
remainingNum: '剩余上传头像次数:' remainingNum: '剩余上传头像次数:',
notFound: '项目不存在',
}, },
Country: { Country: {
unitedStates: '美国', unitedStates: '美国',

View File

@@ -36,10 +36,13 @@
import { useProjectStore } from '@/stores' import { useProjectStore } from '@/stores'
import { getProjectInfo } from '@/api/agent' import { getProjectInfo } from '@/api/agent'
import { clearNodeChat, getNodeAncestors } from '@/api/versitonTree' import { clearNodeChat, getNodeAncestors } from '@/api/versitonTree'
import { useRoute } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import MyEvent from '@/utils/myEvent' import MyEvent from '@/utils/myEvent'
import { useI18n } from 'vue-i18n'
const route = useRoute() const route = useRoute()
const router = useRouter()
const { t } = useI18n()
const projectStore = useProjectStore() const projectStore = useProjectStore()
const previewRef = ref(null) const previewRef = ref(null)
@@ -90,6 +93,11 @@
const handleGetProjectInfoAndHistory = () => { const handleGetProjectInfoAndHistory = () => {
handleOpenSketch() handleOpenSketch()
getProjectInfo({ id: route.params.id }).then((res) => { 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) if (res) agentRef.value.setChatInfo(res)
let data = res?.project || res let data = res?.project || res
if (data?.latestNodeId) data.nodeId = data.latestNodeId if (data?.latestNodeId) data.nodeId = data.latestNodeId