提交 7c265aeb 编写于 作者: WodahsOrez's avatar WodahsOrez

update: 菜单报错,路由404

上级 524c9c56
<script setup lang="ts">
import { useRouter } from 'vue-router';
const router = useRouter();
// 跳转首页回调
const gotoIndexView = ()=>{
router.push("/")
}
</script>
<template>
<div class="app-404">
<div class="app-404__container">
<img src="@/assets/img/404.png" />
<div class="app-404__error-text">
<div class="app-404__error-text1">抱歉,您访问的页面不存在!</div>
<div class="app-404__error-text2">您要找的页面不存在,请返回<a @click="gotoIndexView">首页</a>继续浏览</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.app-404 {
height: 100%;
width: 100%;
}
.app-404__container {
height: 380px;
width: 670px;
position: absolute;
top: calc((100% - 400px) / 2);
left: calc((100% - 670px) / 2);
display: flex;
align-items: center;
}
.app-404__error-text {
padding-left: 20px;
}
.app-404__error-text1 {
font-size: 20px;
margin-bottom: 20px;
}
.app-404__error-text2 {
font-size: 14px;
}
</style>
......@@ -95,7 +95,7 @@ export class RouteUtil {
});
// 如果一个匹配的没有,即没有任何主键匹配上,关系路径为实体自身的pathName
if(routePath == ''){
if(routePath == '' && deResPaths.length > 0){
routePath = "/"+deResPaths[deResPaths.length -1][0].pathName;
}
......
......@@ -31,17 +31,36 @@ const routes = [
{{/each}}
{{/if}}
{{/each}}
{{#each app.allPSAppViews as | appView |}}
{{#unless (or appView.psAppDataEntity appView.defaultPage)}}
{
path: "views/{{lowerCase appView.codeName}}",
meta: {
tag:'{{appView.codeName}}'
},
component: () => import("@views/{{spinalCase appView.psAppModule.codeName}}/{{spinalCase appView.codeName}}"),
},
{{/unless}}
{{/each}}
]
},
{
path: "/",
redirect: "/apps/{{lowerCase app.codeName}}"
},
{
path: '/404',
component: () => import('@components/common/404.vue')
},
{
path: '/login',
name: 'login',
component: () => import("@components/common/login.vue")
}
},
{
path: '/:pathMatch(.*)',
redirect: '/404'
},
]
const router = createRouter({
history: createWebHashHistory(),
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册