1.6.5 • Published 2 years ago

@kaoyaya/fe-eolinker-api-generator v1.6.5

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

eolinker接口api代码生成 查看test/test.js

// 生成的xhr

function createEntity({ name, stock, cost, categoryID, storehose }) {
  return xhr({
    method: 'post',
    headers:{"Content-Type":"multipart/form-data"},
    url: `/api/order/entity/create`,
    data: { name, stock, cost, categoryID, storehose },
    custom:arguments[1] // 自定义参数
  })
}

readline-sync必须要在terminal或者shell中run api 不然会报无法监听TYY的错误

手写实现存在异步问题
// function tipsToContinue() {
//   const rl = readline.createInterface({
//     input: process.stdin,
//     output: process.stdout,
//   });
//   showTip = false;
//   rl.question('当前代码中含有要使用nuxtMode模式生成的接口,是否继续?(Y/N)', function (answer) {
//     if (answer.toLowerCase() === 'y') {
//       rl.close();
//     } else if (answer.toLowerCase() === 'n') {
//       process.exit(0);
//     }
//   });
//   // close事件监听,不加close,则不会结束
//   rl.on('close', function () {
//     // 结束程序
//     process.exit(1);
//   });
// }
1.6.5

2 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.0.0

6 years ago

1.4.1

6 years ago