From 9d0a5366a2066fa1230cf0a008b5974ebfa54e33 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 27 六月 2025 14:58:02 +0800 Subject: [PATCH] feat: v2.2 --- src/router/index.ts | 64 +++++++++++++++++++++++++++++++- 1 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 0e33721..6f35405 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,6 +2,8 @@ import Layout from '@/layout/MainLayout/Layout.vue'; import ErrorLayout from '@/layout/ErrorLayout/ErrorLayout.vue'; +import { AppType } from '@/constants'; +import { loadEnv } from '@build/index'; // import { ElIcons } from '@/typings' @@ -53,6 +55,7 @@ children?: Route[]; }; +//@ts-ignore export const constantRoutes: Route[] = [ { path: '/redirect', @@ -175,6 +178,61 @@ }, ], }, + AppType === 'jx' && { + path: '/BalanceManage', + redirect: 'noRedirect', + component: Layout, + hidden: false, + alwaysShow: true, + meta: { + rank: 10010, + title: '浣欓绠$悊', + rootMenu: true, + icon: 'home', + }, + children: [ + { + path: '/BalanceManage', + name: 'BalanceManage', + hidden: false, + alwaysShow: true, + component: () => import('@/views/BalanceManage/BalanceManage.vue'), + meta: { + rank: 10011, + title: '浣欓绠$悊', + // rootMenu: true, + icon: 'home', + }, + }, + ], + }, + // { + // path: '/FileManage', + // redirect: 'noRedirect', + // component: Layout, + // hidden: false, + // alwaysShow: true, + // meta: { + // rank: 10020, + // title: '鏂囦欢绠$悊', + // rootMenu: true, + // icon: 'home', + // }, + // children: [ + // { + // path: '/FileManage', + // name: 'FileManage', + // hidden: false, + // alwaysShow: true, + // component: () => import('@/views/FileManage/FileManage.vue'), + // meta: { + // rank: 10021, + // title: '鏂囦欢绠$悊', + // icon: 'home', + // }, + // }, + // ], + // }, { path: '/Login', name: 'Login', @@ -213,7 +271,7 @@ }, ], }, -]; +].filter(Boolean); export const asyncRoutes: Route[] = [ { @@ -238,9 +296,11 @@ }, ]; +const { VITE_PUBLIC_PATH } = loadEnv(); + const createRouterFactory = () => createRouter({ - history: createWebHistory(), // hash妯″紡锛歝reateWebHashHistory锛宧istory妯″紡锛歝reateWebHistory + history: createWebHistory(VITE_PUBLIC_PATH), // hash妯″紡锛歝reateWebHashHistory锛宧istory妯″紡锛歝reateWebHistory scrollBehavior(to, from, savedPosition) { return new Promise((resolve) => { if (savedPosition) { -- Gitblit v1.9.1