knowInfo.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <script>
  8. // 禁用鼠标右键
  9. document.addEventListener("contextmenu", function (e) {
  10. e.preventDefault();
  11. });
  12. document.onkeydown = () => {
  13. //禁用F12
  14. if (window.event && window.event.keyCode == 123) {
  15. return false;
  16. //禁用ctrl+shift+i,
  17. } else if (
  18. window.event.ctrlKey &&
  19. window.event.shiftKey &&
  20. window.event.keyCode == 73
  21. ) {
  22. return false;
  23. //屏蔽Shift+F10
  24. } else if (window.event.shiftKey && window.event.keyCode == 121) {
  25. return false;
  26. }
  27. };
  28. </script>
  29. <style>
  30. * {
  31. margin: 0;
  32. padding: 0;
  33. box-sizing: border-box;
  34. }
  35. body {
  36. user-select: none;
  37. width: 100%;
  38. height: 100%;
  39. }
  40. .title {
  41. box-shadow: 0 1px 6px #ccc;
  42. position: fixed;
  43. z-index: 10;
  44. right: 0;
  45. left: 0;
  46. height: 44px;
  47. padding-right: 10px;
  48. padding-left: 10px;
  49. border-bottom: 0;
  50. background-color: #f7f7f7;
  51. text-align: center;
  52. font-size: 17px;
  53. font-weight: 500;
  54. line-height: 44px;
  55. }
  56. .content {
  57. padding: 85px 15px 15px;
  58. }
  59. p {
  60. font-size: 14px;
  61. margin-top: 0;
  62. margin-bottom: 10px;
  63. color: #8f8f94;
  64. text-align: center;
  65. }
  66. /* 移动端样式兼容 */
  67. @media screen and (max-width: 500px) {
  68. * {
  69. max-width: 100% !important;
  70. width: 100% !important;
  71. height: auto !important;
  72. }
  73. html {
  74. width: calc(100% - 20px) !important;
  75. }
  76. body {
  77. width: 100%;
  78. height: auto;
  79. overflow-x: hidden;
  80. padding-bottom: 80px;
  81. }
  82. .title {
  83. position: relative;
  84. background-color: transparent;
  85. /* color: #F0D99C; */
  86. box-shadow: none;
  87. line-height: 30px;
  88. }
  89. .content {
  90. padding: 0;
  91. }
  92. /* p {
  93. color: #fff;
  94. } */
  95. }
  96. </style>
  97. </head>
  98. <script>
  99. const id = window.location.href.split('?sId=')[1]
  100. const fetchUrl = window.location.href.includes('localhost:') ? 'https://ypbwg.4dage.com' : ''
  101. fetch(`${fetchUrl}/api/show/knowledge/cms/detail/${id}`)
  102. .then(response => response.json())
  103. .then(data => {
  104. const dataRes = data.data
  105. const titleDom = document.querySelector('.title')
  106. const contentDom = document.querySelector('.content')
  107. titleDom.innerHTML = dataRes.cName
  108. contentDom.innerHTML = dataRes.cContent
  109. });
  110. </script>
  111. <body>
  112. <!-- 标题 -->
  113. <div class="title"></div>
  114. <!-- 主要内容 -->
  115. <div class="content"></div>
  116. </body>
  117. </html>