You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

site.js 952 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. let _requestVerificationToken = $('input[name="__RequestVerificationToken"]').val();
  2. $.ajaxPrefilter(function (options, originalOptions) {
  3. options.async = true;
  4. if (options.type.toUpperCase() == "POST") {
  5. options.data = $.param($.extend(originalOptions.data, { __RequestVerificationToken: _requestVerificationToken }));
  6. }
  7. });
  8. $.ajaxSetup({ cache: false });
  9. const ajaxPostJsonAsync = (url, data) => {
  10. return $.ajax({
  11. url: url,
  12. cache: false,
  13. async: true,
  14. type: "POST",
  15. dataType: 'json',
  16. data: data
  17. });
  18. }
  19. const ajaxGetJsonAsync = (url, data) => {
  20. return $.ajax({
  21. url: url,
  22. cache: false,
  23. async: true,
  24. type: "GET",
  25. dataType: 'json',
  26. data: data
  27. });
  28. }
  29. const Enums = {
  30. SessionConnectionStatus: Object.freeze({
  31. Disconnected: 0,
  32. Loaded: 4,
  33. Connected: 10
  34. }),
  35. GetName: (enumType, enumKey) => {
  36. return Object.keys(enumType)[enumKey]
  37. },
  38. GetValue: (enumType, enumName) => {
  39. return enumType[enumName];
  40. }
  41. };