preview.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  7. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  8. <meta http-equiv="Pragma" content="no-cache" />
  9. <meta http-equiv="Expires" content="0" />
  10. <meta name="format-detection" content="telephone=no">
  11. <title>清洗手册</title>
  12. </head>
  13. <body>
  14. </body>
  15. <script type="text/javascript">
  16. window.onload = function () {
  17. var searchURL = window.location.search;
  18. searchURL = searchURL.substring(1, searchURL.length);
  19. var token = searchURL.split("&")[0].split("=")[1];
  20. const code = searchURL.split("&")[1].split("=")[1];
  21. const projectId = searchURL.split("&")[2].split("=")[1];
  22. var xmlHttp = null;
  23. if (window.XMLHttpRequest) {
  24. xmlHttp = new XMLHttpRequest();
  25. } else {
  26. xmlHttp = new ActiveXObject("Microsoft.XMLHttpRequest");
  27. }
  28. xmlHttp.onreadystatechange = function () {
  29. if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
  30. var dataObj = JSON.parse(xmlHttp.responseText);
  31. if (dataObj.data.Content) {
  32. document.write(dataObj.data.Content);
  33. } else {
  34. dataObj = `<h3 style="text-align:center">未配置手册,请前往后台配置清洗手册</h3>`
  35. document.write(`<h3 style="text-align:center;padding-top: 40px">未配置手册,请前往后台配置清洗手册</h3>`);
  36. }
  37. document.title = '清洗手册'
  38. }
  39. };
  40. xmlHttp.open("get", "/api/v1/operation_manual/item/" + projectId + "/" + code + "?JWT-TOKEN=" + token + "", true);
  41. xmlHttp.send();
  42. };
  43. </script>
  44. </html>