CMS.Config.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //系统配置
  2. var CMS_SystemConfig = {
  3. VirtualDirectoryPath: "",
  4. ReportPagePath: "/ReportViewer/Page.aspx",
  5. ScriptReportPagePath: "/Common/ReportViewer",
  6. GetConfig: function () {
  7. var configClass = $.ajax({
  8. type: 'GET',
  9. url: CMS_SystemConfig.VirtualDirectoryPath + '/Site.js',
  10. async: false,
  11. dataType: 'xml'
  12. });
  13. return $.String2XML(configClass.responseText);
  14. },
  15. //1:sqlReport,2:PDF
  16. ReportType: 2,
  17. StudentChangeIsEnabled: true,
  18. };
  19. //2014-04-15 modified by pengbb 新增判断是否为null
  20. if (typeof(ZeroClipboard) != "undefined") {
  21. ZeroClipboard.setMoviePath(CMS_SystemConfig.VirtualDirectoryPath + "Scripts/Plugins/ZeroClipboard/ZeroClipboard.swf");
  22. }
  23. //改变jQuery的AJAX默认属性和方法
  24. $.ajaxSetup({
  25. type: 'POST',
  26. error: function (XMLHttpRequest, textStatus, errorThrown) {
  27. $.messager.progress('close');
  28. var reponseText = "";
  29. if ($(XMLHttpRequest.responseText)) {
  30. for (var i = 0; i < $(XMLHttpRequest.responseText).length; i++) {
  31. if ($(XMLHttpRequest.responseText)[i] && $(XMLHttpRequest.responseText)[i].innerText) {
  32. var item = $(XMLHttpRequest.responseText)[i];
  33. if (item.innerText.indexOf("HandleResult") != -1 && item.innerText.indexOf("DetailError") != -1) {
  34. var str = item.innerText;
  35. reponseText = str.substr(str.indexOf("{"));
  36. reponseText = reponseText.substr(0, reponseText.indexOf("}") + 1);
  37. break;
  38. }
  39. }
  40. }
  41. }
  42. var errorObj = $.parseJSON(reponseText);
  43. $.exceptionThrow(errorObj, null);
  44. }
  45. });