@xtdev/bff-request
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

BFF Request

基于axios二次封装,应用于仙潭BFF请求统一管理。

使用

  1. 安装依赖
    npm install @xtdev/bff-request
  1. 引入使用
import XTHttp from '@xtdev/bff-request';

const request = new XTHttp('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'},{
    headers:{
        'Content-Type':'application/json'
    }
});

Readme

Keywords

Package Sidebar

Install

npm i @xtdev/bff-request

Weekly Downloads

1

Version

0.0.6

License

ISC

Unpacked Size

13.8 kB

Total Files

9

Last publish

Collaborators

  • topay
  • lansezhaji
  • zrx546200350