@swg-plugins/auto-api
v0.0.2
Published
> TODO: description
Downloads
1
Readme
@swg-plugins/auto-api
TODO: description
安装
npm i -S @swg-plugins/auto-api
Usage
const AutoApiWebpackPlugin = require('@swg-plugins/auto-api')
configureWebpack: {
plugins: [
new AutoApiWebpackPlugin({
clientUrl: 'http://cg.lp194.365xs.cn/mngapi/client.js?clientID=js_localvue&scopes=ucmng,ucuser,commng,cgmng',
headers: { Referer: 'http://cg.lp194.365xs.cn/mngapi/cgvue/' }, // ClientJs http header option
// outputFileName: 'index.js',
// outputDir:'src/apis' // 导出位置, default: '/src/apis'
// suffixPath: '' 访问 swagger 地址. default: 'Swagger/swagger.json'
})
]
}
// TODO: DEMONSTRATE API
支持 uni 生成 api
const AutoApiWebpackPlugin = require('@swg-plugins/auto-api')
configureWebpack: {
plugins: [
new AutoApiWebpackPlugin({
// swagger 服务对象集合
clientResponse: {
b2cuser: { EndPoint: 'http://b2c.lp194.365xs.cn/b2cuser/'},
ucuser: { EndPoint: 'https://id4lp194.365xs.cn/ucuser/'}
},
// api 请求工具引入地址
importHttp: '\'@/common/utils/http\'',
outputDir: path.join(__dirname, 'api'),
globalKey: 'api', // this.$api.***, 全局工具Key 配置
headers: { Referer: 'http://hk.lp194.365xs.cn/hkmng/hkvue/' } // ClientJs http header option
// outputFileName: 'index.js',
// outputDir:'src/apis' // 导出位置, default: '/src/apis'
// suffixPath: '' 访问 swagger 地址. default: 'Swagger/swagger.json'
})
]
}