From 57ba1d233f0e204a6ac4a5cde0e60bab03369b7e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 15 Nov 2018 18:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80ajax=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/ruoyi/js/common.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js index d6e9d5f5..64b2a834 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js @@ -138,13 +138,15 @@ function createMenuItem(dataUrl, menuName) { return false; } -/** 设置全局ajax超时处理 */ +/** 设置全局ajax处理 */ $.ajaxSetup({ complete: function(XMLHttpRequest, textStatus) { - if (textStatus == "parsererror") { - $.modal.confirm("登陆超时!请重新登陆!", function() { - window.location.href = ctx + "login"; - }) + if (textStatus == 'timeout') { + $.modal.alertWarning("服务器超时,请稍后再试!"); + $.modal.closeLoading(); + } else if (textStatus == "parsererror") { + $.modal.alertWarning("服务器错误,请联系管理员!"); + $.modal.closeLoading(); } } -}); +});