index.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>山峡化工 - 生产一体化门户</title>
  5. <meta charset="UTF-8" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <meta name="description" content="山峡化工生产一体化门户管理系统" />
  8. <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
  9. <style>
  10. /* 防止页面刷新时白屏的初始样式 */
  11. html {
  12. background-color: #fafbfc;
  13. }
  14. html.dark {
  15. background-color: #070707;
  16. }
  17. </style>
  18. <script>
  19. // 小程序 web-view 原生顶栏会显示 document.title;内嵌页用空标题,避免出现门户名/业务名
  20. ;(function () {
  21. try {
  22. var href = String(location.href || '')
  23. var hash = String(location.hash || '')
  24. if (
  25. hash.indexOf('/m/') !== -1 ||
  26. href.indexOf('mpTicket=') !== -1 ||
  27. href.indexOf('mpReturnOrigin=') !== -1
  28. ) {
  29. document.title = '\u200B'
  30. }
  31. } catch (e) {
  32. /* ignore */
  33. }
  34. })()
  35. // 初始化 html class 主题属性
  36. ;(function () {
  37. try {
  38. if (typeof Storage === 'undefined' || !window.localStorage) {
  39. return
  40. }
  41. const themeType = localStorage.getItem('sys-theme')
  42. if (themeType === 'dark') {
  43. document.documentElement.classList.add('dark')
  44. }
  45. } catch (e) {
  46. console.warn('Failed to apply initial theme:', e)
  47. }
  48. })()
  49. </script>
  50. </head>
  51. <body>
  52. <div id="app"></div>
  53. <script type="module" src="/src/main.ts"></script>
  54. </body>
  55. </html>