vợ bảo okeoke

This commit is contained in:
2026-01-02 22:00:50 +07:00
parent 16f64c5e4b
commit 2b0f88fa16
19 changed files with 415 additions and 87 deletions

12
src/routes/NotFound.vue Normal file
View File

@@ -0,0 +1,12 @@
<template>
<vue-head :input="{title: '404 - Page Not Found'}"/>
<div class="mx-auto text-center mt-20 flex flex-col items-center gap-4">
<h1>404 - Page Not Found</h1>
<p>The page you are looking for does not exist.</p>
<router-link class="btn btn-primary" to="/">Go back to Home</router-link>
</div>
</template>
<script setup lang="ts">
import { VueHead } from "@/components/VueHead";
</script>

View File

@@ -75,6 +75,11 @@ const routes: RouteData[] = [
component: () => import("./add/Add.vue"),
},
],
},
{
path: "/:pathMatch(.*)*",
name: "not-found",
component: () => import("./NotFound.vue"),
}
],
},
@@ -88,6 +93,7 @@ const router = createRouter({
router.beforeEach((to, from, next) => {
const auth = useAuthStore();
console.log("Call on server:", Math.random());
if (to.matched.some((record) => record.meta.requiresAuth)) {
if (!auth.user) {
next({ name: "login" });