zhengyiming
8 天以前 2c0bd65affde857b14fb5434dbbfe6ebf97d12dc
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模式:createWebHashHistory,history模式:createWebHistory
    history: createWebHistory(VITE_PUBLIC_PATH), // hash模式:createWebHashHistory,history模式:createWebHistory
    scrollBehavior(to, from, savedPosition) {
      return new Promise((resolve) => {
        if (savedPosition) {