lujing-fe-js-request

1.0.3 • Public • Published

lujing-fe-js-request

组件功能

统一请求方法 支持jsonp

组件部署

cnpm i lujing-fe-js-request

组件用法(demo)

import request from '../lib/index';

request({
  url,
  data: {
    a: 1,
  },
  method: 'get',
}).then(d => {
  console.log(d);
});

//jsonp 请求

request({
  url,
  data: {
    a: 1,
  },
  csrfTokenOptions: {
      key: 'payOnline',
      url: '/marketingScoreNode/proxy/antColonyUmsApi/csrfTokenServlet?csrfType=payOnline&token=token__440b7d96cfaca37af376f0bbff963663',
      method: 'post',
  },//需要获取安全验证的参数
  method: 'get',
  fetchType: 'jsonp',
}).then(d => {
  console.log(d);
});

其他用法 参考 axios

更新log

author

@hanangjie

Readme

Keywords

none

Package Sidebar

Install

npm i lujing-fe-js-request

Weekly Downloads

3

Version

1.0.3

License

ISC

Unpacked Size

42.4 kB

Total Files

7

Last publish

Collaborators

  • hanangjie
  • biuge
  • fujianliang