mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-05 07:27:06 +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 请求参数
|
||||
* @returns {Promise<AxiosResponse<T>>}
|
||||
*/
|
||||
async function request(url, method, params) {
|
||||
async function request(url, method, params, config) {
|
||||
switch (method) {
|
||||
case METHOD.GET:
|
||||
return axios.get(url, {params})
|
||||
return axios.get(url, {params, ...config})
|
||||
case METHOD.POST:
|
||||
return axios.post(url, params)
|
||||
return axios.post(url, params, config)
|
||||
default:
|
||||
return axios.get(url, {params})
|
||||
return axios.get(url, {params, ...config})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user