From b2960f5ea6d51be83f286d298d0d96b72c1ac82a Mon Sep 17 00:00:00 2001 From: sky <2728892662@qq.com> Date: Mon, 11 Jul 2022 11:45:53 +0800 Subject: [PATCH 1/2] projectName null string --- packages/plugin-openapi/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-openapi/src/index.ts b/packages/plugin-openapi/src/index.ts index 774da33c..10f97ecd 100644 --- a/packages/plugin-openapi/src/index.ts +++ b/packages/plugin-openapi/src/index.ts @@ -149,7 +149,7 @@ export default App; } await generateService({ - projectName: pageConfig.name.split('/').pop(), + projectName: pageConfig?.name?.split('/')?.pop() || '/', ...openAPIConfig, serversPath: serversFolder, mockFolder, From 762c95147decae4b70e015fb83c39800b119531d Mon Sep 17 00:00:00 2001 From: sky <2728892662@qq.com> Date: Mon, 11 Jul 2022 11:48:10 +0800 Subject: [PATCH 2/2] projectName null string --- packages/plugin-openapi/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/plugin-openapi/src/index.ts b/packages/plugin-openapi/src/index.ts index 10f97ecd..60801aec 100644 --- a/packages/plugin-openapi/src/index.ts +++ b/packages/plugin-openapi/src/index.ts @@ -149,6 +149,7 @@ export default App; } await generateService({ + // projectName处理package.json没有name的情况 projectName: pageConfig?.name?.split('/')?.pop() || '/', ...openAPIConfig, serversPath: serversFolder,