1.0.3 • Published 2 years ago

zz-fetch v1.0.3

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

fetch

基于axios封装的业务请求包

import {Fetch, Method} from 'zz-fetch'
const fetch = new Fetch('http://api.xxx.com')
export class Interface {
  getData (params) {
    return fetch.send({
      url: '/xxx',
      method: 'get',
      params
    })
  }
  setData (data) {
    return fetch.send({
      url: '/xxx',
      method: Method.post,
      data
    })
  }
}

// 取消请求
const inter = new Interface()
let params = {}
inter.setData(params)
params.cancel()

1

1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

4 years ago

1.0.0

4 years ago