Browse Source

404页面

master
dai 3 years ago
parent
commit
c76d469248
  1. 36
      src/router/index.js
  2. 16
      src/views/modules/404.vue
  3. 16
      src/views/modules/visual/404.vue
  4. 4
      src/views/pages/404.vue

36
src/router/index.js

@ -94,6 +94,16 @@ export const moduleRoutes = {
isTab: true,
},
},
{
path: "404",
props: true,
component: () => import("@/views/modules/404"),
name: "main-404",
meta: {
title: "页面未找到或无权访问",
isTab: false,
},
},
],
};
@ -129,6 +139,16 @@ export const moduleShujuRoutes = {
isTab: false,
},
},
{
path: "404",
props: true,
component: () => import("@/views/modules/visual/404"),
name: "main-shuju-404",
meta: {
title: "页面未找到或无权访问",
isTab: false,
},
},
],
};
@ -519,10 +539,10 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
children: routes,
},
{
path: "*",
// redirect: {
// name: "404",
// },
path: "/main/*",
redirect: {
path: "/main/404",
},
},
]);
window.SITE_CONFIG["dynamicMenuRoutes"] = routes;
@ -593,10 +613,10 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
children: routes,
},
{
path: "*",
// redirect: {
// name: "404",
// },
path: "/main-shuju/*",
redirect: {
path: "/main-shuju/404",
},
},
]);
window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes;

16
src/views/modules/404.vue

@ -0,0 +1,16 @@
<template>
<div class="m-404">页面未找到或无权访问</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.m-404 {
margin-top: 200px;
font-size: 60px;
color: rgba(#000, 0.3);
text-align: center;
}
</style>

16
src/views/modules/visual/404.vue

@ -0,0 +1,16 @@
<template>
<div class="m-404">页面未找到或无权访问</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.m-404 {
margin-top: 200px;
font-size: 60px;
color: rgba(#fff, 0.6);
text-align: center;
}
</style>

4
src/views/pages/404.vue

@ -2,11 +2,11 @@
<div class="aui-wrapper aui-page__not-found">
<div class="aui-content__wrapper">
<div class="aui-content">
<h2 class="title">404</h2>
<h2 class="title" style="font-size: 60px">页面未找到或无权访问</h2>
<p class="desc" v-html="$t('notFound.desc')"></p>
<div class="btn-bar">
<el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button>
<el-button type="primary" @click="$router.push({ name: 'home' })">{{ $t('notFound.home') }}</el-button>
<el-button type="primary" @click="$router.push({ name: 'index' })">{{ $t('notFound.home') }}</el-button>
</div>
</div>
</div>

Loading…
Cancel
Save