This commit is contained in:
张成
2026-04-01 10:37:51 +08:00
parent 494555a6e1
commit 7199c6b5cf
10 changed files with 187 additions and 17 deletions

8
app.js
View File

@@ -27,8 +27,12 @@ async function start() {
const { buildProxyRoutes } = require('./api/controller_custom/proxy_api');
// 从 swagger.json 动态注册 193 个转发路由到 /api 前缀
const proxyRoutes = buildProxyRoutes();
framework.addRoutes('/api', proxyRoutes);
console.log(`📡 已注册 ${Object.keys(proxyRoutes).length} 个 API 转发路由`);
const n = Object.keys(proxyRoutes).length;
// 与 swagger 文档一致:/admin/...、/login/...
framework.addRoutes("", proxyRoutes);
// 兼容历史调用:/api/admin/...
framework.addRoutes("/api", proxyRoutes);
console.log(`📡 已注册 ${n} 个转发接口(文档路径 + /api 前缀各一套)`);
}
});