head_script.jsp 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
  2. <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
  3. <%
  4. String basePath = request.getContextPath();
  5. %>
  6. <script type="text/javascript" src="<%=basePath %>/resource/plugins/jquery/jquery-2.1.4.min.js"></script>
  7. <script type="text/javascript" src="<%=basePath %>/resource/plugins/sweetalert.min.js"></script>
  8. <script type="text/javascript">
  9. function checkAuthentication(){
  10. var isAuthenticated = false;
  11. <shiro:authenticated>
  12. isAuthenticated = true;
  13. </shiro:authenticated>
  14. if(isAuthenticated){
  15. return true;
  16. }
  17. location.href = "<%=basePath%>/open/account/login.htm";
  18. return false;
  19. }
  20. window.alert = function(name){
  21. var iframe = document.createElement("IFRAME");
  22. iframe.style.display="none";
  23. iframe.setAttribute("src", 'data:text/plain,');
  24. document.documentElement.appendChild(iframe);
  25. window.frames[0].window.alert(name);
  26. iframe.parentNode.removeChild(iframe);
  27. };
  28. </script>