修改 传入参数方式

This commit is contained in:
GGJ
2024-08-01 13:58:32 +08:00
parent d7a9b1023e
commit 78dfa759ed
3 changed files with 10 additions and 4 deletions

View File

@@ -227,14 +227,16 @@ function getPendingKey(config: AxiosRequestConfig) {
/**
* 根据请求方法组装请求数据/参数
*/
export function requestPayload(method: Method, data: anyObj) {
export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) {
if (method == 'GET') {
return {
params: data
}
} else if (method == 'POST') {
return {
data: data
if (paramsPOST) {
return { params: data }
} else {
return { data: data }
}
}
}