feat: init

This commit is contained in:
2026-01-16 13:01:40 +07:00
commit 5b6477559f
34 changed files with 13714 additions and 0 deletions

18
src/router/auth.ts Normal file
View File

@@ -0,0 +1,18 @@
import type { RouteRecordRaw } from "vue-router";
const routes: Array<RouteRecordRaw> = [
{
path: "/auth/login",
component: () => import("@/views/auth/login/index.vue"),
},
{
path: "/auth/signup",
component: () => import("@/views/auth/signup/index.vue"),
},
{
path: "/auth/term",
component: () => import("@/views/auth/term.vue"),
},
];
export default routes;

7
src/router/guard.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { Router } from "vue-router";
export function createRouterGuard(router: Router) {
router.beforeEach(async (to, from, next) => {
next();
});
}

35
src/router/index.ts Normal file
View File

@@ -0,0 +1,35 @@
import type { RouteRecordRaw } from "vue-router";
import { createRouter, createWebHistory } from "@ionic/vue-router";
import authRoutes from "./auth";
import { createRouterGuard } from "./guard";
const routes: Array<RouteRecordRaw> = [
{
path: "/",
redirect: "/layout/home",
},
{
path: "/:pathMatch(.*)*",
redirect: "/layout/home",
},
// ...authRoutes,
{
path: "/layout",
component: () => import("@/components/layout/default.vue"),
children: [
{
path: "home",
component: () => import("@/views/home/index.vue"),
},
],
},
];
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes,
});
createRouterGuard(router);
export { router };