mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
🔱: [client] sync upgrade with 7 commits [trident-sync]
chore: Merge branch 'vben' # Conflicts: # package.json perf: antdv示例改成使用vben框架 chore: vben chore: vben chore: vben
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import type { ComponentRecordType, GenerateMenuAndRoutesOptions } from "/@/vben/types";
|
||||
|
||||
import { generateAccessible } from "/@/vben/access";
|
||||
import { preferences } from "/@/vben/preferences";
|
||||
|
||||
import { BasicLayout, IFrameView } from "/@/vben/layouts";
|
||||
|
||||
const forbiddenComponent = () => import("#/views/_core/fallback/forbidden.vue");
|
||||
|
||||
async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
const pageMap: ComponentRecordType = import.meta.glob("../views/**/*.vue");
|
||||
|
||||
const layoutMap: ComponentRecordType = {
|
||||
BasicLayout,
|
||||
IFrameView
|
||||
} as any;
|
||||
|
||||
return await generateAccessible(preferences.app.accessMode, {
|
||||
...options,
|
||||
// fetchMenuListAsync: async () => {
|
||||
// message.loading({
|
||||
// content: `${$t("common.loadingMenu")}...`,
|
||||
// duration: 1.5
|
||||
// });
|
||||
// return await getAllMenusApi();
|
||||
// },
|
||||
// 可以指定没有权限跳转403页面
|
||||
forbiddenComponent,
|
||||
// 如果 route.meta.menuVisibleWithForbidden = true
|
||||
layoutMap,
|
||||
pageMap
|
||||
});
|
||||
}
|
||||
|
||||
export { generateAccess };
|
||||
Reference in New Issue
Block a user