fix:修复404
This commit is contained in:
parent
02e2b7f325
commit
6dfe6863c5
@ -53,8 +53,17 @@ const routes = [
|
|||||||
path: "oauth/github",
|
path: "oauth/github",
|
||||||
name: "GithubRedirect",
|
name: "GithubRedirect",
|
||||||
component: GithubOauth
|
component: GithubOauth
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "notFound",
|
||||||
|
name: "NOTFOUND",
|
||||||
|
component: () => import("@/views/public/pages/NotFound")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "*",
|
||||||
|
redirect: "/public/notFound"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "Public",
|
name: "Public",
|
||||||
async created() {
|
async created() {
|
||||||
//进入注册、登录页需要清理掉所有的缓存数据
|
|
||||||
await this.$store.dispatch("treeData/clear");
|
|
||||||
await this.$store.dispatch("globalConfig/clear");
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -42,7 +39,7 @@ export default {
|
|||||||
|
|
||||||
@media screen and (min-width: 500px) {
|
@media screen and (min-width: 500px) {
|
||||||
.main-body {
|
.main-body {
|
||||||
width: 5rem;
|
min-width: 5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +69,10 @@ export default {
|
|||||||
async created() {
|
async created() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
window.addEventListener("storage", this.storageDeal.bind(this));
|
window.addEventListener("storage", this.storageDeal.bind(this));
|
||||||
|
|
||||||
|
//进入注册、登录页需要清理掉所有的缓存数据
|
||||||
|
await this.$store.dispatch("treeData/clear");
|
||||||
|
await this.$store.dispatch("globalConfig/clear");
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
window.removeEventListener("storage", this.storageDeal);
|
window.removeEventListener("storage", this.storageDeal);
|
||||||
|
23
bookmark_front/src/views/public/pages/NotFound.vue
Normal file
23
bookmark_front/src/views/public/pages/NotFound.vue
Normal 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>
|
@ -79,6 +79,11 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
async created() {
|
||||||
|
//进入注册、登录页需要清理掉所有的缓存数据
|
||||||
|
await this.$store.dispatch("treeData/clear");
|
||||||
|
await this.$store.dispatch("globalConfig/clear");
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit() {
|
submit() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user