From f8ee507ad7de22f61cf18f73a12ff68ff08b0ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 27 Jan 2021 10:42:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ajax=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/js/common/common.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erp_web/js/common/common.js b/erp_web/js/common/common.js index 488f2904..31fdc7d3 100644 --- a/erp_web/js/common/common.js +++ b/erp_web/js/common/common.js @@ -7,6 +7,15 @@ s.parentNode.insertBefore(hm, s); })(); + //全局配置 + $.ajaxSetup({ + beforeSend: function(jqXHR, settings) { + //在请求前给修改url(增加一个时间戳参数) + settings.url += settings.url.match(/\?/) ? "&" : "?"; + settings.url += "t=" + new Date().getTime(); + } + }); + $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray();