92 lines
2.1 KiB
TypeScript
92 lines
2.1 KiB
TypeScript
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"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "service",
|
|
component: () => import("@/views/service/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "product",
|
|
component: () => import("@/views/product/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "profile",
|
|
component: () => import("@/views/profile/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "/check_in",
|
|
component: () => import("@/views/check_in/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/invite",
|
|
component: () => import("@/views/invite/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/settings",
|
|
component: () => import("@/views/settings/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/real_name",
|
|
component: () => import("@/views/real_name/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/address",
|
|
component: () => import("@/views/address/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/address/add",
|
|
component: () => import("@/views/address/add.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/payment",
|
|
component: () => import("@/views/payment/index.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: "/payment/add",
|
|
component: () => import("@/views/payment/add.vue"),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
];
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
routes,
|
|
});
|
|
|
|
createRouterGuard(router);
|
|
|
|
export { router };
|