global.js 599 B

1234567891011121314151617181920212223242526
  1. /**
  2. * 全局设置(必须引用)
  3. *
  4. * @author jcl
  5. * @company yihu.com
  6. * @since 2014-12-22
  7. */
  8. $(document).ready(function() {
  9. //ajax全局设置
  10. $.ajaxSetup({
  11. cache : false,
  12. complete : function(XHR, TS) {
  13. var resText = XHR.responseText;
  14. var sessionstatus = XHR.getResponseHeader("sessionstatus");
  15. var loginPath = XHR.getResponseHeader("loginPath");
  16. if (911 == XHR.status && "timeout" == sessionstatus) {
  17. //if (window.confirm('session timeout')) {
  18. // window.location.replace(loginPath);
  19. //}
  20. window.location.replace(loginPath);
  21. return;
  22. }
  23. }
  24. });
  25. });