查不到项目就跳转创建项目页面
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user