mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
解决bug:ai大模型-ai应用管理-配置菜单后404 #8111
This commit is contained in:
16
jeecgboot-vue3/src/views/super/registerSuper.ts
Normal file
16
jeecgboot-vue3/src/views/super/registerSuper.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import type { App } from 'vue';
|
||||
|
||||
/**
|
||||
* 动态引入 super 下的组件
|
||||
*/
|
||||
export async function registerSuper(app: App) {
|
||||
const modules = import.meta.glob('./**/register.ts');
|
||||
for (let [url, module] of Object.entries(modules)) {
|
||||
let { register } = await module();
|
||||
if (typeof register === 'function') {
|
||||
await register(app);
|
||||
} else {
|
||||
console.error(`${url} 没有导出 register 函数,无法完成注册!`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user