diff --git a/.gitignore b/.gitignore index a4b670db709815f8c262a5157e5acf3769bf21b5..d94f5966d4e9d26430147d293080776d6c65e7a0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ pnpm-debug.log* *.njsproj *.sln *.sw? +/package-lock.json diff --git a/src/main.ts b/src/main.ts index 6b39f542b542be2639ac726f1e45068cf94ff8ce..ccd709f117b4ba1ab7187b3b3228ff1a6439cc35 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,28 +19,37 @@ async function bootstrap() { const app = createApp(App); // Configure store + // 配置 store setupStore(app); // Initialize internal system configuration + // 初始化内部系统配置 initAppConfigStore(); // Register global components + // 注册全局组件 registerGlobComp(app); // Multilingual configuration + // 多语言配置 // Asynchronous case: language files may be obtained from the server side + // 异步案例:语言文件可能从服务器端获取 await setupI18n(app); // Configure routing + // 配置路由 setupRouter(app); // router-guard + // 路由守卫 setupRouterGuard(router); // Register global directive + // 注册全局指令 setupGlobDirectives(app); // Configure global error handling + // 配置全局错误处理 setupErrorHandle(app); // https://next.router.vuejs.org/api/#isready diff --git a/src/router/index.ts b/src/router/index.ts index c349151543c4545b611220a191aac6a169c87e1e..3107c46876d6a94834e03825ea7db714374589bf 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -14,9 +14,13 @@ const getRouteNames = (array: any[]) => getRouteNames(basicRoutes); // app router +// 创建一个可以被 Vue 应用程序使用的路由实例 export const router = createRouter({ + // 创建一个 hash 历史记录。 history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH), + // 应该添加到路由的初始路由列表。 routes: basicRoutes as unknown as RouteRecordRaw[], + // 是否应该禁止尾部斜杠。默认为假 strict: true, scrollBehavior: () => ({ left: 0, top: 0 }), }); diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index 149ec42a0d9ba49eef207ac4fe43b01b98c26bd7..8cf4831ef7b09caf8ba756ddee0dd256e5d4f6ae 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -37,6 +37,7 @@ export const LoginRoute: AppRouteRecordRaw = { }; // Basic routing without permission +// 未经许可的基本路由 export const basicRoutes = [ LoginRoute, RootRoute,