Browse Source

feat: specialCustomizeHttp 接口post 请求参数问题

main
betaqi 2 weeks ago
parent
commit
ba5ddcb1e8
  1. 19
      src/api/http.ts

19
src/api/http.ts

@ -289,17 +289,14 @@ export const specialCustomizeHttp = async ( @@ -289,17 +289,14 @@ export const specialCustomizeHttp = async (
// 类型处理
try {
const url = (new Function("return `" + `${import.meta.env.VITE_DEV_PATH}${axiosPre}${requestConfig.url}`.trim() + "`"))();
debugger
return await axiosInstance(
{
url,
method: requestConfig.method,
data,
params,
headers
}
)
const url = (new Function("return `" + `${requestConfig.url}`.trim() + "`"))();
const axiosConfig =
requestConfig.method.toUpperCase() === 'GET'
? { url, method: requestConfig.method, params, headers }
: { url, method: requestConfig.method, data: params, headers }
return await axiosInstance(axiosConfig)
} catch (error) {
console.error(error)
window['$message']?.error('URL 地址格式有误!')

Loading…
Cancel
Save