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

Loading…
Cancel
Save