banner2.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
  2. <%@ page import="cn.sinobest.framework.comm.iface.IOperator" %>
  3. <%@ page import="cn.sinobest.sysmngr.comm.ConVar" %>
  4. <%@ page import="cn.sinobest.framework.util.Util,cn.sinobest.framework.util.DTOUtil,cn.sinobest.framework.util.DateUtil,cn.sinobest.framework.util.ConfUtil,cn.sinobest.framework.comm.Environment"%>
  5. <%@ page import="java.util.List,java.util.Map" %> <%@ page import="cn.sinobest.sysmngr.service.blank.BlankService" %>
  6. <%@ page import="cn.sinobest.sysmngr.service.blank.BlankService" %>
  7. <%@ page import="java.text.DateFormat,java.text.SimpleDateFormat,java.util.Date" %>
  8. <%@include file="./taglib.jsp" %>
  9. <%@ page import="cn.sinobest.appcomm.service.sy.AppcommSyService"%>
  10. <%
  11. final String token = DTOUtil.getToken(response,session);
  12. //字典获取方法
  13. final String DICT_MODE = ConfUtil.getSysParam("app.dictMode","server");
  14. IOperator Operator = null;
  15. Object obj = request.getSession().getAttribute(ConVar.LOGIN_SESSION_ID);
  16. String CurDate = DateUtil.CurDate.YYYYMMDD_ZH.getDate();
  17. //始终比设定的时间多1分钟,这样系统超时的话就会自动跳到登录界面
  18. //例如系统有可能在SESSION 50分钟的时候,开始不用,那么需要等到1个小时以后,才会自动转到登录界面
  19. long timeout = 3700*1000;
  20. String LoginID ="";
  21. String SessionID ="";
  22. String OperName ="";
  23. String OperUnitName="";
  24. String LoginType = (String)request.getSession().getAttribute("LOGINTYPE");
  25. String OperId = "";
  26. String shortcutHtml = "";
  27. String OperType2 = "";
  28. if(obj != null){
  29. Operator = (IOperator)obj;
  30. LoginID = Operator.getLoginID();
  31. OperName = Operator.getOperName();
  32. OperId = Operator.getOperID();
  33. OperUnitName = Operator.getOperUnitName();
  34. SessionID = (String)request.getSession().getId();
  35. OperType2 = Operator.getOperType2();
  36. BlankService blankService = (BlankService)Util.getBean("blankService");
  37. shortcutHtml = blankService.getShortcutHtml(OperId,request.getContextPath());
  38. }
  39. if(LoginType==null){
  40. LoginType="loginsb";
  41. }
  42. boolean isSheBaoUser = true;
  43. if(OperType2 != null && !"1".equals(OperType2)){
  44. isSheBaoUser = false;
  45. }
  46. String jsMin = "";
  47. if (Environment.getAppProductMode()) {
  48. jsMin = "-min";
  49. }
  50. //首页按钮,根据用户类型跳转不同首页,管理员、窗口用户、科室用户
  51. // Object obj = request.getSession().getAttribute(ConVar.LOGIN_SESSION_ID);
  52. // IOperator Operator = (IOperator) obj;
  53. String OperID = Operator.getOperID();
  54. AppcommSyService appcommSyService = (AppcommSyService)Util.getBean("appcommSyService");
  55. String usertype = appcommSyService.getUserTypeByRight(OperID);
  56. String syurl="";
  57. if(usertype.equals("ksuser")){
  58. syurl="framework/blank2.jsp?RightID=blank";
  59. request.getSession().setAttribute("SYUSERTYPE", "KS");
  60. }else if(usertype.equals("ckuser")){
  61. syurl="ck/web/ywsl/ywsl_q.jsp?RightID=blank";
  62. request.getSession().setAttribute("SYUSERTYPE", "CK");
  63. }else{
  64. syurl="framework/blank3.jsp?RightID=blank";
  65. }
  66. %>
  67. <html>
  68. <head>
  69. <title>系统标题栏</title>
  70. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  71. <%-- <% if ("-min".equals(jsMin)) { %>
  72. <link href="${ctx}/themes/default/fw-all-default<%=jsMin%>.css" rel="stylesheet" type="text/css">
  73. <% } else { %> --%>
  74. <link href="${ctx}/themes/default/default.css" rel="stylesheet" type="text/css">
  75. <%-- <% } %> --%>
  76. <!--[if IE 6]>
  77. <link href="${ctx}/themes/default/ie6.css" rel="stylesheet" type="text/css">
  78. <![endif]-->
  79. <link href="${ctx}/themes/default/banner.css" rel="stylesheet" type="text/css">
  80. <script src="${ctx}/js/comm/lib/jquery.js"></script>
  81. <script src="${ctx}/js/comm/lib/json2<%=jsMin%>.js"></script>
  82. <script src="${ctx}/js/comm/fw/ajax<%=jsMin%>.js"></script>
  83. <script src="${ctx}/js/comm/lib/jquery.cookie.js" language="JavaScript" type="text/javascript"></script>
  84. <script src="<%=request.getContextPath()%>/js/comm/fw/encrypt.js"></script>
  85. <script src="<%=request.getContextPath()%>/js/comm/fw/encrypt2.js"></script>
  86. </head>
  87. <style>
  88. .topover img{
  89. border: 0px;
  90. width: 16px;
  91. height: 16px;
  92. padding:0 4px 4px 2px;
  93. vertical-align:middle;
  94. }
  95. .bannerbutton a{
  96. text-decoration: none;
  97. border: 0px solid white;
  98. padding: 1px 6px 1px 6px;
  99. }
  100. .bannerbutton a:hover{
  101. border: 0px solid #F1C40F;
  102. color: #F1C40F;
  103. font-weight: bold;
  104. }
  105. .tdLeft{
  106. width: 13px;height: 22px;
  107. background: url('source/bg-left.png') no-repeat;
  108. }
  109. .tdRight{
  110. width: 13px;height: 22px;
  111. background: url('source/bg-right.png') no-repeat;
  112. }
  113. .tdCenter{
  114. height: 22px;
  115. line-height:20px;
  116. background: url('source/bg-center.png') repeat-x;
  117. }
  118. .userimg{
  119. width: 20px;height: 20px;
  120. background: url('source/user.png') no-repeat;
  121. display:inline-block;
  122. }
  123. /*.bannerbutton table p{
  124. display:block !important;
  125. margin-block-start:1em !important;
  126. margin-block-end:1em !important;
  127. margin-inline-start:0px;
  128. margin-inline-end:0px;
  129. margin-top:-12px !important;
  130. }
  131. */
  132. </style>
  133. <body leftmargin="0" topmargin="0">
  134. <FORM name="frm" method="post" action="<%=request.getContextPath()%>/framework/security/<%=LoginType%>!logout.do" >
  135. <input type="hidden" name="_rtnURL" value="<%=request.getContextPath()%>/framework/banner.do" />
  136. <div id="_bannerbutton" class="bannerbutton" style="height:100%;">
  137. <table width=100% height=100% cellSpacing=1 cellPadding=1 border=0>
  138. <tr>
  139. <td width="100%" align="right" nowrap>
  140. <table border=0 cellSpacing=0 cellPadding=0 class="userName">
  141. <tr height="25px">
  142. <td class="tdLeft"></td>
  143. <td class="tdCenter">
  144. <span class="userimg">&nbsp;</span>
  145. <span class="topover"><%=OperName%></span>&nbsp;&nbsp;
  146. <span class="topover"><%=OperUnitName%></span>
  147. </td>
  148. <td class="tdRight">&nbsp;</td>
  149. </tr>
  150. </table>
  151. <p class="header_right_box">
  152. <a class="topover" href="${ctx}/jsp/<%=syurl %>" target=workspace ><img src="${ctx}/jsp/framework/source/banner-home.png">首页</a>
  153. <!--<a class="topover" href="javascript:void(0);" onclick="showBulletinDialog();"><img src="${ctx}/jsp/framework/source/banner-notice.png">公告</a> -->
  154. <!--<a class="topover" href="javascript:void(0);" onclick="showShortcut();"><img src="${ctx}/jsp/framework/source/banner-shortcut.png">常用菜单</a>-->
  155. <%-- <a class="topover" href="javascript:void(0);" onclick="mpass();" ><img src="${ctx}/jsp/framework/source/banner-pwd.png">修改密码</a>
  156. <a class="topover" href="javascript:void(0);" onclick="relogon();" ><img src="${ctx}/jsp/framework/source/banner-relogin.png">重新登录</a>
  157. <a class="topover" href="javascript:void(0);" onclick="doclose();"><img src="${ctx}/jsp/framework/source/banner-exit.png">退出</a> --%>
  158. <!-- <a class="topover" href="javascript:doLink();" >帮助</a> -->
  159. </p>
  160. </td>
  161. </tr>
  162. </table>
  163. </div>
  164. <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="header_bg">
  165. <tr>
  166. <td width="461"><span class="logo-name">湛江一窗通办系统</span><!-- <img src="${ctx}/themes/default/images/banner5.gif" width="458" height="49">--></td>
  167. <td width="32" background="#0B408B;">&nbsp;</td>
  168. </tr>
  169. </table>
  170. </FORM>
  171. </body>
  172. <script language="javascript">
  173. var contextPath='${ctx}';
  174. var GVAR = {'dictMode':'<%=DICT_MODE%>',
  175. 'dicts':{}
  176. };
  177. var token = '<%=token%>';
  178. var shortData = null;
  179. //窗口的非正常退出时调用
  180. //window.attachEvent("onunload",doCloseWin);
  181. //document.all._bannerbutton.style.top="20px";
  182. setTimeout("doReload()",<%=timeout%>);//刷新
  183. function doReload(){
  184. if(self.top.window.detachEvent){
  185. self.top.window.detachEvent("onunload",doCloseWin);
  186. }else{
  187. self.top.window.removeEventListener("onunload",doCloseWin);
  188. }
  189. var services=[{serviceId:'seccuritySession',method:'iftimeout',parameters:{ifjy:true}}];
  190. $.ajax({
  191. url:contextPath+'/ajaxAdapter.do'
  192. ,data:{parameters:JSON.stringify(services)}
  193. ,dataType :'json'
  194. ,cache:false
  195. ,async:false
  196. ,type:'post'
  197. ,error:function (request, textStatus, errorThrown) {}
  198. ,success:function (data, textStatus) {
  199. if(data.Token !=null){
  200. token =data.Token;//更新全局变量token标志
  201. }
  202. //校验业务处理是否正确执行
  203. if("1"!=data.FHZ){//出错了,弹出错误提醒
  204. if ("loginTimeout" == data.FHZ) {
  205. var flag=window.confirm("登录超时,是否重新登录?");
  206. if(flag){
  207. var nWidth = screen.availWidth-10;
  208. var nHeight = screen.availHeight-50;
  209. window.open("<%=request.getContextPath()%>"+"/index.jsp","","top=0,left=0,width="+nWidth+",height="+nHeight+",toolbar=no,resizable=yes,status=1,scrollbars")
  210. window.opener=null;
  211. window.open("","_self");
  212. window.close();
  213. try{ window.parent.close();}catch(e){}
  214. }
  215. }else if("CSRF" == data.FHZ){
  216. showMsg(data.MSG||'',3);
  217. return;
  218. }
  219. }else{
  220. self.location.reload();
  221. }
  222. },
  223. beforeSend:function(XMLHttpRequest ){
  224. var cToken = $.cookie("Token") || token;XMLHttpRequest.setRequestHeader('Token',cToken);
  225. }
  226. });
  227. }
  228. function relogon(){
  229. if (!window.confirm("是否退出系统?")) {
  230. return;
  231. }
  232. if(window.detachEvent){
  233. window.detachEvent("onunload",doCloseWin);;
  234. }else{
  235. window.removeEventListener("onunload",doCloseWin);
  236. }
  237. doCloseWin();
  238. createCookie("RS_ID","",-1,"/");
  239. createCookie("RS_PW","",-1,"/");
  240. window.top.location.href="${ctx}/jsp/framework/security/<%=LoginType%>_i.jsp";
  241. }
  242. function doclose(){
  243. if (window.confirm("是否退出系统?")) {
  244. window.parent.close();
  245. }
  246. }
  247. function mpass(){
  248. if(window.detachEvent){
  249. window.detachEvent("onunload",doCloseWin);;
  250. }else{
  251. window.removeEventListener("onunload",doCloseWin);
  252. }
  253. window.top.location.href="${ctx}/jsp/framework/security/pwdrest_u.jsp";
  254. }
  255. <%-- 此处用AJAX去销毁SESSION 销毁的动作在类 AjaxAction 内完成 --%>
  256. function doCloseWin(){
  257. var args = {'SD':'<%=SessionID%>'};
  258. var services=[{serviceId:'securityLogoutService',method:'logout',parameters:args}];
  259. $.ajax({
  260. url:contextPath+'/ajaxAdapter.do'
  261. ,data:{parameters:JSON.stringify(services)}
  262. ,dataType :'json'
  263. ,cache:false
  264. ,async:false
  265. ,type:'post'
  266. ,error:function (request, textStatus, errorThrown) {}
  267. ,success:function (data, textStatus) {
  268. if(data.Token!=null){
  269. token=data.Token;//更新全局变量token标志
  270. }
  271. },
  272. beforeSend:function(XMLHttpRequest ){
  273. var cToken = $.cookie("Token") || token;XMLHttpRequest.setRequestHeader('Token',cToken);
  274. }
  275. });
  276. }
  277. <%-- 弹出常用菜单窗口 --%>
  278. window.shortcut = {operId:"<%=OperId%>",shortcutHtml: "<%=shortcutHtml%>"};
  279. function showShortcut(){
  280. var title = encodeURIComponent('常用菜单');
  281. var url = "shortcut.jsp?title=" + title + "&_t=" + new Date().getTime();
  282. var position = "resizable:1;status:0;help:0;scroll:1;center:1;dialogWidth:900px;dialogHeight:450px";
  283. window.showModalDialog(url,window,position);
  284. }
  285. <%-- 弹出查阅公告窗口 --%>
  286. function showBulletinDialog(){
  287. var title = encodeURIComponent('查阅公告');//对话框的标题
  288. var url = "blank_bulletin.jsp?title="+title;
  289. var position="resizable:1;status:0;help:0;scroll:1;center:1;dialogWidth:1024px;dialogHeight:500px";
  290. window.showModalDialog(url,window,position);
  291. }
  292. </script>
  293. <script>
  294. parent.mLoadStatus.banner = true;
  295. </script>
  296. </html>