index.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <link rel="icon" href="/favicon.ico" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  8. <meta name="renderer" content="webkit">
  9. <script id="TMap" charset="utf-8"></script>
  10. <title></title>
  11. </head>
  12. <body>
  13. <div id="app"></div>
  14. <script> this.globalThis || (this.globalThis = this) </script>
  15. <script type="module" src="/src/main.js"></script>
  16. <script>
  17. console.log('mall4j.v240506')
  18. const webConfigData = JSON.parse(localStorage.getItem('bbcWebConfigData'))
  19. if (webConfigData) {
  20. document.title = webConfigData.bsTitleContent || ''
  21. let facicon = document.querySelector('link[rel="icon"]')
  22. if (facicon !== null) {
  23. facicon.href = webConfigData.bsTitleImg
  24. } else {
  25. facicon = document.createElement('link')
  26. facicon.rel = 'icon'
  27. facicon.href = webConfigData.bsTitleImg
  28. document.head.appendChild(facicon)
  29. }
  30. }
  31. if (!Array.prototype.flatMap) {
  32. Object.defineProperty(Array.prototype,'flatMap',{
  33. value:function (callback) {
  34. return this.reduce(function (result, item) {
  35. const mapped = callback(item);
  36. return result.concat(mapped);
  37. }, [])
  38. },
  39. enumerable:false,
  40. })
  41. }
  42. // .flat 兼容低版本浏览器
  43. if (!Array.prototype.flat) {
  44. Object.defineProperty(Array.prototype,'flat',{
  45. value:function (depth = 1) {
  46. const array = this
  47. if (depth === Infinity) depth = Number.MAX_SAFE_INTEGER
  48. return array.reduce((acc, val) => acc.concat(Array.isArray(val) && depth > 0 ? flatten(val, depth - 1) : val), [])
  49. },
  50. enumerable:false,
  51. })
  52. }
  53. </script>
  54. </body>
  55. </html>