diff --git a/src/components/LoginModal.vue b/src/components/LoginModal.vue index c31615a..d49b96d 100644 --- a/src/components/LoginModal.vue +++ b/src/components/LoginModal.vue @@ -46,7 +46,7 @@ + diff --git a/src/pages/notfound/index.vue b/src/pages/notfound/index.vue new file mode 100644 index 0000000..2e32206 --- /dev/null +++ b/src/pages/notfound/index.vue @@ -0,0 +1,30 @@ + + + 404 + Not Found + 返回主页 + + + + + diff --git a/src/pages/staging/index.vue b/src/pages/staging/index.vue new file mode 100644 index 0000000..6a0f9fa --- /dev/null +++ b/src/pages/staging/index.vue @@ -0,0 +1,53 @@ + + + Hi, {{ name }}: + + 感谢你注册About Life! 我们发送了激活邮件到你的邮箱: {{ email }}. + 请前往你的邮箱激活账户, 激活账户就可以正常登陆About Life啦! + + + + + + + diff --git a/src/router/index.ts b/src/router/index.ts index 909e971..8f77340 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,9 +1,10 @@ import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"; import Home from "@/pages/home/Home.vue"; +import Staging from "@/pages/staging/index.vue"; const routes: Array = [ { path: "/", - name: "home", + name: "Home", component: Home, }, { @@ -11,6 +12,12 @@ const routes: Array = [ name: "Content", component: () => import("@/pages/content/Content.vue"), }, + { + path: "/staging", + name: "Staging", + component: Staging, + props: true, + }, // { // path: "/about", // name: "about", @@ -20,6 +27,11 @@ const routes: Array = [ // component: () => // import(/* webpackChunkName: "about" */ "../views/AboutView.vue"), // }, + { + path: "/:pathMatch(.*)*", + name: "NotFound", + component: () => import("@/pages/notfound/index.vue"), + }, ]; const router = createRouter({ @@ -27,4 +39,12 @@ const router = createRouter({ routes, }); +router.beforeEach((to, from, next) => { + if (to.name === "Media" && localStorage.role !== "0") { + next({ name: "NotFound" }); + } else { + next(); + } +}); + export default router;
感谢你注册About Life! 我们发送了激活邮件到你的邮箱: {{ email }}.
请前往你的邮箱激活账户, 激活账户就可以正常登陆About Life啦!