From ba5ddcb1e8740e29c09fd8532ed62db0fc0a3978 Mon Sep 17 00:00:00 2001 From: betaqi <3188864257@qq.com> Date: Tue, 21 Oct 2025 14:11:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20specialCustomizeHttp=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3post=20=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/http.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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 地址格式有误!')