From b26b4654afdbb1d44ea26270293a45d6c48cc965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 19 Jan 2017 23:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E7=9A=84bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebRoot/pages/common/main.jsp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/WebRoot/pages/common/main.jsp b/WebRoot/pages/common/main.jsp index 85f7bed3..7179f832 100644 --- a/WebRoot/pages/common/main.jsp +++ b/WebRoot/pages/common/main.jsp @@ -105,25 +105,14 @@ //加载桌面 HROS.base.init(); } - function JSGetCookie(Name) { - var search = Name + "=" - if (document.cookie.length > 0) { - offset = document.cookie.indexOf(search) - if (offset != -1) { - offset += search.length - end = document.cookie.indexOf(";", offset) - if (end == -1) end = document.cookie.length - return unescape(document.cookie.substring(offset, end)) - } - else return "" + //判断是否存在session,如果不存在就跳到登录界面 + function UserOut() { + var kid = ${sessionScope.user.id}; + if (!kid){ + top.location.href = '../../'; } } - function UserOut() { - if (JSGetCookie("UserId") == null) - top.location.href = '../../'; - } - setInterval(UserOut, 5000); - + setInterval(UserOut, 5000); //每5秒检测一次 });