zhaoxing
2022-02-15 11f76d73f09c535c3f9aac32e357c02f9934ed11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {
    createRouter,
    createWebHashHistory,
    createWebHistory,
    Router,
    RouteRecordRaw
} from "vue-router";
import { routerMode } from "/@/config/env";
 
declare interface CoolRouter extends Router {
    $plugin?: {
        addViews(list: any[], options?: any): void;
    };
}
 
const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "index",
        component: () => import(`/@/pages/layout/index.vue`),
        children: [
            {
                path: "/",
                name: "数据统计",
                component: () => import("/@/views/home/index.vue")
            }
        ]
    },
    {
        path: "/:catchAll(.*)",
        name: "404",
        redirect: "/404"
    }
];
 
const router = createRouter({
    history: routerMode == "history" ? createWebHistory() : createWebHashHistory(),
    routes
}) as CoolRouter;
 
export default router;
 
export const ignore: any = {
    token: ["/login", "/403", "/404", "/500", "/502"]
};