diff --git a/src/api/http.ts b/src/api/http.ts index 5e0a208..33fed5c 100644 --- a/src/api/http.ts +++ b/src/api/http.ts @@ -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 地址格式有误!')