$.ajaxSetup({ cache:false, beforeSend:function (jqXHR, settings) { if (settings.url.indexOf('${resource(dir: 'login')}') == -1 && checkLoginFlag) { checkLoginFlag = false; //1秒馁不重复进行验证 setTimeout(function () { checkLoginFlag = true; }, 1000); $.get('url', function (data) { if (data != 'true') { art.dialog.alert('您的登陆已经过期,请重新登录!', function () { window.location.href = '${createLink(uri: '/login')}'; }); } }); } }, complete: function() { //隐藏表单提交提示 formLay.hide(); formLoading.hide(); } });