@lark-apaas/devtool-kits 1.2.17-alpha.19 → 1.2.17-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3355,7 +3355,8 @@ async function fetchRoutesFromBackend(basePath) {
3355
3355
  }
3356
3356
  const data = await response.json();
3357
3357
  const routeConfig = data["\u8DEF\u7531\u914D\u7F6E"];
3358
- if (!routeConfig || !routeConfig.routes) {
3358
+ if (!routeConfig || !routeConfig.routes || !Array.isArray(routeConfig.routes)) {
3359
+ console.warn("[api-list] Invalid routes data:", routeConfig);
3359
3360
  return [];
3360
3361
  }
3361
3362
  const debugRoutes = routeConfig.routes;
@@ -3402,15 +3403,6 @@ __name(createApiListHandler, "createApiListHandler");
3402
3403
  function createDevLogRouter(options = {}) {
3403
3404
  const logDir = resolveLogDir(options.logDir);
3404
3405
  const router = import_express2.default.Router();
3405
- router.use((_req, res, next) => {
3406
- res.header("Access-Control-Allow-Origin", "*");
3407
- res.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
3408
- res.header("Access-Control-Allow-Headers", "Content-Type, Accept");
3409
- next();
3410
- });
3411
- router.options("*", (_req, res) => {
3412
- res.status(204).end();
3413
- });
3414
3406
  router.get("/app/trace/:traceId", createGetTraceEntriesHandler(logDir));
3415
3407
  router.get("/trace/recent", createGetRecentTracesHandler(logDir));
3416
3408
  router.get("/files/:fileName", createGetLogFileHandler(logDir));