You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
474 B
26 lines
474 B
|
3 years ago
|
import { createRouter, createWebHashHistory } from "vue-router";
|
||
|
|
|
||
|
|
let routes = [
|
||
|
|
{
|
||
|
|
path: "/",
|
||
|
|
redirect: "/login",
|
||
|
|
name: "App",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
path: "/:pathMatch(.*)*",
|
||
|
|
name: "404",
|
||
|
|
component: () => import("@/views/404"),
|
||
|
|
},
|
||
|
|
];
|
||
|
|
|
||
|
|
routes = $globalRouterModules(routes); // 加载模块路由
|
||
|
|
|
||
|
|
const $globalRouter = createRouter({
|
||
|
|
history: createWebHashHistory(),
|
||
|
|
routes,
|
||
|
|
});
|
||
|
|
|
||
|
|
$globalExpandRouter($globalRouter, routes); // 添加路由扩展
|
||
|
|
|
||
|
|
export { $globalRouter };
|