@xtdev/bff-request-miniprogram
v0.0.6
Published
a http request for xiantan BFF
Downloads
2
Readme
BFF Request Miniprogram
基于小程序网络请求封装,应用于仙潭BFF请求统一管理。
使用
- 安装依赖
npm i @xtdev/bff-request-miniprogram
- 引入使用
import BFFRequest from '@xtdev/bff-request-miniprogram';
const request = new BFFRequest('http://yourhost');
// 请求拦截
request.requestInterceptor(function(config){return config});
// 响应拦截
request.responseInterceptor(function(response){return response});
// get请求
request.get('/paipath', {params1: 'your request path'});
// post请求自定义header
request.post('/paipath', {params1: 'your request path'},{
header:{
'Content-Type':'application/json'
}
});