Forráskód Böngészése

修改离线包图标

wangfumin 3 hónapja
szülő
commit
c05e43a5ad
2 módosított fájl, 1 hozzáadás és 45 törlés
  1. 1 45
      offline.html
  2. BIN
      public/oldfavicon.ico

+ 1 - 45
offline.html

@@ -2,57 +2,13 @@
 <html lang="en">
   <head>
     <meta charset="UTF-8" />
-    <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
+    <link rel="icon" type="image/svg+xml" href="/oldfavicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>案件信息</title>
     <link rel="stylesheet" type="text/css" href="./lib/Cesium/Widgets/CesiumWidget/CesiumWidget.css">
     <link rel="stylesheet" type="text/css" href="./lib/Cesium/Widgets/CesiumWidget/lighter.css">
     <script>window.offline = true</script>
   </head>
-  <script>
-    // 获取URL参数中的app值
-    function getAppParam() {
-      const urlParams = new URLSearchParams(window.location.search);
-      return {app: urlParams.get('app'), isSample: urlParams.get('isSample')};
-    }
-
-    // 根据app参数设置favicon
-    function setFavicon() {
-      const appParam = getAppParam();
-      // 获取基础路径
-      const basePath = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
-      let faviconPath = basePath + 'favicon.ico'; // 默认图标
-      console.log(appParam, basePath, 6666)
-      if (appParam.app == '1') {
-        faviconPath = basePath + 'fire.ico';
-      } else if (appParam.app == '2' && appParam.isSample == '1') {
-        faviconPath = basePath + 'police.ico';
-      } else if (appParam.app == '3') {
-        faviconPath = basePath + 'jmlogo.png';
-      } else if (appParam.app == '2' && appParam.isSample == '0') {
-        faviconPath = basePath + 'logo_big.ico';
-      }
-      
-      // 查找现有的favicon链接元素
-      let link = document.querySelector("link[rel~='icon']");
-      
-      // 如果没有找到,创建一个新的
-      if (!link) {
-        link = document.createElement('link');
-        link.rel = 'icon';
-        document.head.appendChild(link);
-      }
-      
-      // 设置favicon路径
-      link.href = faviconPath;
-    }
-
-    // 页面加载时设置favicon
-    window.addEventListener('load', setFavicon);
-    
-    // 当URL通过History API变化时也更新favicon
-    window.addEventListener('popstate', setFavicon);
-  </script>
   <body>
     <div id="app"></div>
     <script type="module" src="/src/main.ts"></script>

BIN
public/oldfavicon.ico