fix:修复404

This commit is contained in:
fanxb 2021-03-17 19:36:27 +08:00
parent 02e2b7f325
commit 6dfe6863c5
5 changed files with 42 additions and 4 deletions

View File

@ -53,8 +53,17 @@ const routes = [
path: "oauth/github",
name: "GithubRedirect",
component: GithubOauth
},
{
path: "notFound",
name: "NOTFOUND",
component: () => import("@/views/public/pages/NotFound")
}
]
},
{
path: "*",
redirect: "/public/notFound"
}
];

View File

@ -12,9 +12,6 @@
export default {
name: "Public",
async created() {
//
await this.$store.dispatch("treeData/clear");
await this.$store.dispatch("globalConfig/clear");
},
};
</script>
@ -42,7 +39,7 @@ export default {
@media screen and (min-width: 500px) {
.main-body {
width: 5rem;
min-width: 5rem;
}
}

View File

@ -69,6 +69,10 @@ export default {
async created() {
let _this = this;
window.addEventListener("storage", this.storageDeal.bind(this));
//
await this.$store.dispatch("treeData/clear");
await this.$store.dispatch("globalConfig/clear");
},
destroyed() {
window.removeEventListener("storage", this.storageDeal);

View File

@ -0,0 +1,23 @@
<template>
<div class="main">
页面走丢了3s后返回首页
</div>
</template>
<script>
export default {
name: "NotFound",
created() {
setTimeout(() => {
this.$router.replace("/");
}, 3000);
},
};
</script>
<style lang="less" scoped>
.main {
width: 100%;
height: 100%;
}
</style>

View File

@ -79,6 +79,11 @@ export default {
},
};
},
async created() {
//
await this.$store.dispatch("treeData/clear");
await this.$store.dispatch("globalConfig/clear");
},
methods: {
submit() {
let _this = this;