mirror of
https://github.com/iczer/vue-antd-admin.git
synced 2025-04-05 19:42:00 +08:00
新增:request.js 增加请求配置参数;
feat: add configuration parameter for request.js;
This commit is contained in:
parent
62b57a97cb
commit
df076bda24
@ -30,14 +30,14 @@ const METHOD = {
|
|||||||
* @param params 请求参数
|
* @param params 请求参数
|
||||||
* @returns {Promise<AxiosResponse<T>>}
|
* @returns {Promise<AxiosResponse<T>>}
|
||||||
*/
|
*/
|
||||||
async function request(url, method, params) {
|
async function request(url, method, params, config) {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case METHOD.GET:
|
case METHOD.GET:
|
||||||
return axios.get(url, {params})
|
return axios.get(url, {params, ...config})
|
||||||
case METHOD.POST:
|
case METHOD.POST:
|
||||||
return axios.post(url, params)
|
return axios.post(url, params, config)
|
||||||
default:
|
default:
|
||||||
return axios.get(url, {params})
|
return axios.get(url, {params, ...config})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user