From 0a58a05d8671c0fd998cfbe607977ba5fe056859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Fri, 10 Nov 2023 18:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20eps=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/cool/eps/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/cool/eps/index.ts b/build/cool/eps/index.ts index bbab58c..dcd336a 100644 --- a/build/cool/eps/index.ts +++ b/build/cool/eps/index.ts @@ -179,8 +179,8 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service: item.api.forEach((a) => { // 方法名 - const n = toCamel(a.name || last(a.path.split("/")) || "").replace( - /[:\/-]/g, + const n = (a.name || last(a.path.split("/")) || "").replace( + /[:\/]/g, "" ); @@ -203,7 +203,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service: const a = `${p.name}${p.required ? "" : "?"}`; const b = `${p.schema.type || "string"}`; - q.push(`${a}: ${b},`); + q.push(`"${a}": ${b},`); }); if (isEmpty(q)) { @@ -250,7 +250,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service: t.push(" */\n"); t.push( - `${n}(data${q.length == 1 ? "?" : ""}: ${q.join( + `"${n}"(data${q.length == 1 ? "?" : ""}: ${q.join( "" )}): Promise<${res}>;` ); @@ -266,7 +266,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service: t.push(" */\n"); t.push( `permission: { ${permission - .map((e) => `${e}: string;`) + .map((e) => `"${e}": string;`) .join("\n")} };` ); @@ -277,7 +277,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service: t.push(" */\n"); t.push( `_permission: { ${permission - .map((e) => `${e}: boolean;`) + .map((e) => `"${e}": boolean;`) .join("\n")} };` ); @@ -382,7 +382,7 @@ function createService() { n = n.split("/:")[0]; } - d[k][toCamel(n)] = a; + d[k][n] = a; } });