1.0.3 • Published 1 year ago

zz-fetch v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.0.3

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago