This commit is contained in:
2026-06-02 13:34:54 +08:00
parent d7469b9622
commit 4d9b763d18
46 changed files with 0 additions and 2718 deletions

View File

@@ -1,19 +0,0 @@
import type { Router } from "vue-router";
/**
* 通用路由守卫
*/
function setupCommonGuard(router: Router) {
// @ts-ignore
router.beforeEach(async (to, from) => {
// TODO: 路由守卫
return true;
});
}
// 路由守卫
function createRouterGuard(router: Router) {
setupCommonGuard(router);
}
export { createRouterGuard };

View File

@@ -1,16 +0,0 @@
import { createMemoryHistory, createRouter } from "vue-router";
import routes from "./routes";
import { createRouterGuard } from "@/router/guard.ts";
/**
* 创建路由实例
*/
const router = createRouter({
history: createMemoryHistory(),
routes
});
// 创建路由守卫
createRouterGuard(router);
export { router };

View File

@@ -1,29 +0,0 @@
import type { RouteRecordRaw } from "vue-router";
const routes: RouteRecordRaw[] = [
{
path: "/",
name: "Root",
component: () => import("@/components/HelloWorld.vue"),
children: []
},
{
path: "/auth",
name: "Authentication",
component: () => import("@/layouts/authPage/authPageLayout.vue"),
children: [
{
path: "login",
name: "Login",
component: () => import("@/views/auth/login.vue")
},
{
path: "register",
name: "Register",
component: () => import("@/views/auth/register.vue")
}
]
}
];
export default routes;