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 1.0 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. LLamaExecutorType: Object.freeze({
  36. Interactive: 0,
  37. Instruct: 1,
  38. Stateless: 2
  39. }),
  40. GetName: (enumType, enumKey) => {
  41. return Object.keys(enumType)[enumKey]
  42. },
  43. GetValue: (enumType, enumName) => {
  44. return enumType[enumName];
  45. }
  46. };