global.js 553 B

12345678910111213141516171819202122232425
  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. return;
  21. }
  22. }
  23. });
  24. });