修复当登录超时后点击查询页面的查询按钮无响应的BUG

This commit is contained in:
yigekaiguan 2021-09-18 15:18:05 +08:00
parent 637cd54cc7
commit d334d9197b
3 changed files with 19 additions and 4 deletions

View File

@ -3469,15 +3469,25 @@
else
{
var rtPrefix = jqXHR.responseText.substr(0, 100);
var dpnValue = null;
var dpnToken = "dg-page-name=\"";
var dpnStartIdx = rtPrefix.indexOf(dpnToken);
if(dpnStartIdx > -1)
{
dpnStartIdx = dpnStartIdx + dpnToken.length;
var dpnEndIdx = rtPrefix.indexOf("\"", dpnStartIdx);
dpnValue = (dpnEndIdx > dpnStartIdx ? rtPrefix.substring(dpnStartIdx, dpnEndIdx) : null);
}
//响应为HTML操作消息的
if(rtPrefix.indexOf("<!--HTML_OPERATION_MESSAGE-->") >= 0)
if(dpnValue == "error")
{
$omp.html(jqXHR.responseText);
hasResponseMessage = true;
}
//当登录超时后列表页点击【查询】按钮ajax响应可能会重定向到登录页这里特殊处理
else if(rtPrefix.indexOf("<!--LOGIN_PAGE-->") >= 0)
else if(dpnValue == "login")
{
var url = ajaxSettings.url;
@ -3508,6 +3518,11 @@
{
$.tipError(thrownError);
}
//客户端连接出错
else if(event && event.type=="ajaxError")
{
$.tipError("Error");
}
};
/**JSON内容类型常量*/

View File

@ -11,10 +11,10 @@
<#if isJsonResponse>
<@writeJson var=operationMessage />
<#else>
<!--HTML_OPERATION_MESSAGE-->
<#include "include/html_doctype.ftl">
<html>
<head>
<meta dg-page-name="error" />
<#include "include/html_head.ftl">
<title><#include "include/html_title_app_name.ftl"><@spring.message code='error.errorOccure' /></title>
</head>

View File

@ -6,11 +6,11 @@
* http://www.gnu.org/licenses/lgpl-3.0.html
*
-->
<!--LOGIN_PAGE-->
<#include "include/import_global.ftl">
<#include "include/html_doctype.ftl">
<html>
<head>
<meta dg-page-name="login" />
<#include "include/html_head.ftl">
${detectNewVersionScript?no_esc}
<title><#include "include/html_title_app_name.ftl"><@spring.message code='login.login' /></title>