@xm-fe/create-api
Advanced tools
Comparing version 0.0.5-beta.3 to 0.0.5-beta.4
{ | ||
"name": "@xm-fe/create-api", | ||
"version": "0.0.5-beta.3", | ||
"version": "0.0.5-beta.4", | ||
"description": "API快速导入", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,3 +76,3 @@ ## ⚡️ 简介 | ||
module.exports = { | ||
remotePath: `http://127.0.0.1:4523/export/openapi/4?version=3.0`, | ||
remotePath: `http://127.0.0.1:4523/export/openapi/4?version=3.0&projectId=xxxx`, | ||
language: 'js', | ||
@@ -110,3 +110,3 @@ // 插入的模板代码 | ||
module.exports = { | ||
remotePath: `http://127.0.0.1:4523/export/openapi/4?version=3.0`, | ||
remotePath: `http://127.0.0.1:4523/export/openapi/4?version=3.0&projectId=xxxx`, | ||
language: 'ts', // 生成的语言的使用方式 默认 'ts', 可选值:'js' | 'ts' | ||
@@ -124,3 +124,3 @@ // 插入的模板代码 | ||
*/ | ||
export function ${api.name}( | ||
export function ${api.fileName || api.name}( | ||
${pathParams ? pathParams : ''} | ||
@@ -127,0 +127,0 @@ ${api.queryParams ? `params?: ${api.queryParams._name},` : ''} |
@@ -122,3 +122,3 @@ const fs = require('fs') | ||
// 如果以数字开头的不生成 | ||
if (isNumber(name[0]) || /^.*?(http|localhost|_|\,).*?$/.test(name)) { | ||
if (isNumber(name[0]) || /^.*?(http|localhost|\,).*?$/.test(name)) { | ||
abnormalApi.push(api.url) | ||
@@ -125,0 +125,0 @@ return |
36599