Ver código fonte

feat: 增加美国孙总的favicon和title

Ritchie 1 ano atrás
pai
commit
d962ba128b
3 arquivos alterados com 31 adições e 3 exclusões
  1. BIN
      public/aetiFavicon.ico
  2. 31 2
      public/index.html
  3. 0 1
      src/views/home/index.vue

BIN
public/aetiFavicon.ico


+ 31 - 2
public/index.html

@@ -5,8 +5,8 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>Sunzee</title>
+    <link rel="icon" id="favicon" href="<%= BASE_URL %>favicon.ico">
+    <title>Loading...</title>
     <link rel="stylesheet" href="./fontIcon.css">
     <script type="text/javascript" src="./echarts.min.js"></script>
     <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
@@ -18,6 +18,35 @@
         Please enable it to continue.</strong>
 </noscript>
 <div id="app"></div>
+<script>
+    const domainSettings = {
+        'szwlh.sunzee.com.cn': {
+            favicon: 'favicon.ico',
+            title: 'Sunzee'
+        },
+        'szwltest.sunzee.com.cn': {
+            favicon: 'favicon.ico',
+            title: 'Sunzee'
+        },
+        'localhost': {
+            favicon: 'favicon.ico',
+            title: 'Sunzee'
+        },
+        'portalmcc.com.cn': {
+            favicon: 'aetiFavicon.ico',
+            title: 'AETI GLOBAL'
+        }
+    };
+    const currentDomain = window.location.hostname;
+    const settings = domainSettings[currentDomain]
+
+    if (settings) {
+        document.getElementById('favicon').setAttribute('href', settings.favicon)
+        document.title = settings.title
+    } else {
+        console.log('Domain settings not found');
+    }
+</script>
 </body>
 
 </html>

+ 0 - 1
src/views/home/index.vue

@@ -468,7 +468,6 @@ export default {
     const getTitleFunc = async () => {
       const currentDomain = window.location.href;
       // const currentDomain = window.location.hostname;
-      // console.log("currentDomain >>>", currentDomain);
       switch (true) {
         // case currentDomain.includes('/shenze/'):
         //   sysTitle.value = 'AETI GLOBAL';