0.1.1 • Published 1 year ago

jd-request v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

JD request

jd-request 是基于Axios的二次封装,使之更符合我们系统的功能需求。

安装

npm install -S jd-request

使用

import { axiosRequest, axiosDownload } from 'jd-request'

const baseURL = 'http://xxxx'

// 普通请求
export function getUserAccount(params = {}) {
	return axiosRequest({
		baseURL,
		url: '/url1',
		method: 'GET',
		params,
	})
}

// 文件流导出请求
export function exportFile(data = {}) {
	return axiosDownload({
		baseURL,
		url: '/url2',
		method: 'POST',
		data,
	})
}
0.1.1

1 year ago

0.1.0

1 year ago