site.js 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
  2. // for details on configuring this project to bundle and minify static web assets.
  3. // Write your JavaScript code.
  4. function getWebConsoleAPI(parameter, callBack) {
  5. var href = window.location.href;
  6. var path = window.location.pathname;
  7. let basicUrl = href.slice(0, href.indexOf(path));
  8. var serviceUrl = basicUrl + "/u/?apitype=service&an=ShowMeApi&pn=ProcessorsDispatcher&en=Edge.Core.Processor.Dispatcher.DefaultDispatcher";
  9. $.ajax({
  10. url: serviceUrl,
  11. datatype: "application/json",
  12. type: 'post',
  13. contentType: "application/json;charset=utf-8;",
  14. data: JSON.stringify(parameter),
  15. beforeSend: function () {
  16. },
  17. success: function (data) {
  18. console.log(data);
  19. if (data !== null && Array.isArray(data) && data.length > 0) {
  20. if (callBack !== null) callBack(data[0].Path);
  21. } else {
  22. if (callBack !== null) callBack(null);
  23. }
  24. },
  25. error: function (err) {
  26. console.log(err);
  27. if (callBack !== null) callBack(null);
  28. }
  29. });
  30. }