index.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <meta name="theme-color" content="#000000" />
  7. <meta name="description" content="Web site created using create-react-app" />
  8. <meta
  9. name="viewport"
  10. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
  11. />
  12. <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
  13. <!-- <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> -->
  14. <script src="./myData/data.js"></script>
  15. <title>楚国第一玉剑数字展</title>
  16. </head>
  17. <body>
  18. <noscript>You need to enable JavaScript to run this app.</noscript>
  19. <div id="root"></div>
  20. </body>
  21. <!-- <script>
  22. window.onload = function () {
  23. var script = document.createElement('script')
  24. script.src = 'https://cdn.bootcss.com/eruda/1.5.4/eruda.min.js'
  25. document.body.appendChild(script)
  26. script.onload = function () {
  27. eruda.init()
  28. }
  29. }
  30. </script> -->
  31. <script>
  32. // -------------增加访问量--------------------
  33. // 初始接口域名
  34. const baseUrl = 'https://sit-cctvyunzhan.4dage.com'
  35. const requestBody = {
  36. num: 'CGYJ_CODE',
  37. type: 'visit'
  38. };
  39. fetch(`${baseUrl}/api/visit/add`, {
  40. method: 'POST',
  41. body: JSON.stringify(requestBody),
  42. headers: {
  43. 'Content-Type': 'application/json'
  44. }
  45. })
  46. .then(response => response.json())
  47. .then(data => console.log('访问量增加'))
  48. .catch(error => console.error(error));
  49. </script>
  50. </html>