diff --git a/bookmark_front/src/router/index.js b/bookmark_front/src/router/index.js index 01c77cd..ea52f0e 100644 --- a/bookmark_front/src/router/index.js +++ b/bookmark_front/src/router/index.js @@ -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" } ]; diff --git a/bookmark_front/src/views/public/Public.vue b/bookmark_front/src/views/public/Public.vue index e69976b..d3dd1fc 100644 --- a/bookmark_front/src/views/public/Public.vue +++ b/bookmark_front/src/views/public/Public.vue @@ -12,9 +12,6 @@ export default { name: "Public", async created() { - //进入注册、登录页需要清理掉所有的缓存数据 - await this.$store.dispatch("treeData/clear"); - await this.$store.dispatch("globalConfig/clear"); }, }; @@ -42,7 +39,7 @@ export default { @media screen and (min-width: 500px) { .main-body { - width: 5rem; + min-width: 5rem; } } diff --git a/bookmark_front/src/views/public/pages/Login.vue b/bookmark_front/src/views/public/pages/Login.vue index 0c91a0c..a8b4c89 100644 --- a/bookmark_front/src/views/public/pages/Login.vue +++ b/bookmark_front/src/views/public/pages/Login.vue @@ -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); diff --git a/bookmark_front/src/views/public/pages/NotFound.vue b/bookmark_front/src/views/public/pages/NotFound.vue new file mode 100644 index 0000000..4893b36 --- /dev/null +++ b/bookmark_front/src/views/public/pages/NotFound.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/bookmark_front/src/views/public/pages/Register.vue b/bookmark_front/src/views/public/pages/Register.vue index e39bb31..ac3656c 100644 --- a/bookmark_front/src/views/public/pages/Register.vue +++ b/bookmark_front/src/views/public/pages/Register.vue @@ -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;