mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-02-05 07:24:12 +00:00
调整 eps 方法名
This commit is contained in:
parent
7ce127a8b8
commit
0a58a05d86
@ -179,8 +179,8 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service:
|
|||||||
|
|
||||||
item.api.forEach((a) => {
|
item.api.forEach((a) => {
|
||||||
// 方法名
|
// 方法名
|
||||||
const n = toCamel(a.name || last(a.path.split("/")) || "").replace(
|
const n = (a.name || last(a.path.split("/")) || "").replace(
|
||||||
/[:\/-]/g,
|
/[:\/]/g,
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service:
|
|||||||
const a = `${p.name}${p.required ? "" : "?"}`;
|
const a = `${p.name}${p.required ? "" : "?"}`;
|
||||||
const b = `${p.schema.type || "string"}`;
|
const b = `${p.schema.type || "string"}`;
|
||||||
|
|
||||||
q.push(`${a}: ${b},`);
|
q.push(`"${a}": ${b},`);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isEmpty(q)) {
|
if (isEmpty(q)) {
|
||||||
@ -250,7 +250,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service:
|
|||||||
t.push(" */\n");
|
t.push(" */\n");
|
||||||
|
|
||||||
t.push(
|
t.push(
|
||||||
`${n}(data${q.length == 1 ? "?" : ""}: ${q.join(
|
`"${n}"(data${q.length == 1 ? "?" : ""}: ${q.join(
|
||||||
""
|
""
|
||||||
)}): Promise<${res}>;`
|
)}): Promise<${res}>;`
|
||||||
);
|
);
|
||||||
@ -266,7 +266,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service:
|
|||||||
t.push(" */\n");
|
t.push(" */\n");
|
||||||
t.push(
|
t.push(
|
||||||
`permission: { ${permission
|
`permission: { ${permission
|
||||||
.map((e) => `${e}: string;`)
|
.map((e) => `"${e}": string;`)
|
||||||
.join("\n")} };`
|
.join("\n")} };`
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ async function createDescribe({ list, service }: { list: Eps.Entity[]; service:
|
|||||||
t.push(" */\n");
|
t.push(" */\n");
|
||||||
t.push(
|
t.push(
|
||||||
`_permission: { ${permission
|
`_permission: { ${permission
|
||||||
.map((e) => `${e}: boolean;`)
|
.map((e) => `"${e}": boolean;`)
|
||||||
.join("\n")} };`
|
.join("\n")} };`
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ function createService() {
|
|||||||
n = n.split("/:")[0];
|
n = n.split("/:")[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
d[k][toCamel(n)] = a;
|
d[k][n] = a;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user