Merge commit 'a1bc17ccd0b7d1539a6a9ed9eef5555afc058a73' into main

This commit is contained in:
xiaoxian521
2021-11-10 22:48:45 +08:00
85 changed files with 8328 additions and 5709 deletions

View File

@@ -5,6 +5,7 @@ import {
createWebHashHistory,
RouteRecordNormalized
} from "vue-router";
import { RouteConfigs } from "/@/layout/types";
import { split, uniqBy } from "lodash-es";
import { i18n } from "/@/plugins/i18n";
import { openLink } from "/@/utils/link";
@@ -18,6 +19,7 @@ import { usePermissionStoreHook } from "/@/store/modules/permission";
import homeRouter from "./modules/home";
import Layout from "/@/layout/index.vue";
import errorRouter from "./modules/error";
import externalLink from "./modules/externalLink";
import remainingRouter from "./modules/remaining";
// 动态路由
import { getAsyncRoutes } from "/@/api/routes";
@@ -25,7 +27,11 @@ import { getAsyncRoutes } from "/@/api/routes";
// https://cn.vitejs.dev/guide/features.html#glob-import
const modulesRoutes = import.meta.glob("/src/views/*/*/*.vue");
const constantRoutes: Array<RouteComponent> = [homeRouter, errorRouter];
const constantRoutes: Array<RouteComponent> = [
homeRouter,
externalLink,
errorRouter
];
// 按照路由中meta下的rank等级升序来排序路由
export const ascending = arr => {
@@ -181,7 +187,7 @@ export function resetRouter() {
}
// 路由白名单
const whiteList = ["/login", "/register"];
const whiteList = ["/login"];
router.beforeEach((to, _from, next) => {
if (to.meta?.keepAlive) {