feat(utils): 重构路由生成逻辑

- 移除 autoRoutes.js 文件,改为使用 apps.js 存储路由信息
- 新增 createRoutes 函数,用于动态生成应用路由
- 更新 build.js,增加路由生成步骤
- 修改 router.js,使用新的路由配置
- 更新 .gitignore,忽略新的 apps.js 文件
This commit is contained in:
aixianling
2024-12-17 09:34:57 +08:00
parent c8d75ab72a
commit 536f579523
7 changed files with 97 additions and 116 deletions

View File

@@ -6,7 +6,6 @@ import utils from './utils';
import vcUI from 'dui/packages';
import appComp from 'dui/dv';
import store from './utils/store';
import autoRoutes from "./utils/autoRoutes";
import extra from "./config.json"
import axios from "./utils/axios";
//备注底座信息,勿删
@@ -19,7 +18,7 @@ Vue.config.productionTip = false;
Vue.prototype.$cdn = "https://cdn.cunwuyun.cn"
Vue.prototype.$request = axios
Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e]));
const loadPage = () => autoRoutes.init().finally(() => new Vue({router, store, render: h => h(App)}).$mount("#app"))
const loadPage = () => new Vue({router, store, render: h => h(App)}).$mount("#app")
let theme = null
store.dispatch('getSystem', extra.sysInfo).then(res => {
theme = JSON.parse(res?.colorScheme || null)