From 68086a49e7df33683408b6de1a7fbc48137591d6 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 13 Jul 2024 15:58:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ajax=E6=96=B0=E5=A2=9Edelete=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/assets/lib/layui/customer/ajaxPostUtil.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js index 0623f153e..c131fd456 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/ajaxPostUtil.js @@ -156,10 +156,13 @@ var AjaxPostUtil = { setRequestHeaders(xmlhttp); if("GET" === method.toUpperCase()) { xmlhttp.send(null); - } else if("POST" === method.toUpperCase() || "PUT" === method.toUpperCase() || "DELETE" === method.toUpperCase()) { + } else if("POST" === method.toUpperCase() || "PUT" === method.toUpperCase()) { // 如果是POST提交,设置请求头信息 xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send(formateParams); + } else if("DELETE" === method.toUpperCase()) { + xmlhttp.setRequestHeader("Content-Type", "application/json"); + xmlhttp.send(JSON.stringify(ajaxObj.options.params)); } } }; \ No newline at end of file -- GitLab