hs-request
v1.0.5
Published
axios封装请求模块
Downloads
5
Readme
hs-modules-request
axios封装请求模块
usage
// request.js
import http from 'hs-request'
const myRequest = new http({
options,requestFn,responseFn
})
myRequest.init()
export myRequest
// xx.vue
import myRequest from './request'
myRequest.post(url,data).then(res=> {})
myRequest.get(url,data).then(res=> {})
myRequest.put(url,data).then(res=> {})
myRequest.delete(url,data).then(res=> {})
options
baseURL: 请求地址 headers: 请求头