diff --git a/src/app.ts b/src/app.ts index 8e70761..05f1420 100644 --- a/src/app.ts +++ b/src/app.ts @@ -41,12 +41,13 @@ const apps = { const filePath = path.join(folderPath, file); try { - logger.debug(`尝试加载模块: ${filePath}`); + //logger.debug(`尝试加载模块: ${filePath}`); const controllerModule = require(filePath); const controller = controllerModule.default; if (controller?.getRouter) { - const routePath = `/api/${folder}`; + const isPublic = folder === 'public'; + const routePath = isPublic ? `/${folder}` : `/api/${folder}`; app.use(routePath, controller.getRouter()); logger.debug(`模块路由挂载: ${routePath.padEnd(12)} => ${file}`);