mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-14 22:30:31 +08:00
Merge commit 'a1bc17ccd0b7d1539a6a9ed9eef5555afc058a73' into main
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user