Quellcode durchsuchen

Merge branch 'master' of http://face3d.4dage.com:7005/shaogen1995/ShouBo

任一存 vor 2 Jahren
Ursprung
Commit
30c6ae3737
3 geänderte Dateien mit 14 neuen und 9 gelöschten Zeilen
  1. 3 2
      web/src/App.vue
  2. 9 6
      webM/src/App.vue
  3. 2 1
      webM/vue.config.js

+ 3 - 2
web/src/App.vue

@@ -10,6 +10,7 @@
 export default {
 
   created() {
+
     // 移动端和pc端的切换
     if (
       window.navigator.userAgent.match(
@@ -17,8 +18,8 @@ export default {
       )
     ) {
       // 移动端
-      if (window.location.href.includes("/index.html#/")) {
-        window.location.href = window.location.href.replace("/index.html#/", "mobile/index.html#/");
+      if (window.location.href.includes('en.capitalmuseum.org.cn')) {
+        window.location.href = window.location.origin + '/mobile/index.html#/Layout/Home'
         setTimeout(() => {
           location.reload(true);
         }, 200);

+ 9 - 6
webM/src/App.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="app">
-    <Router-view/>
+    <Router-view />
   </div>
 </template>
 
@@ -18,21 +18,24 @@ export default {
     ) {
       // 移动端
     } else {
-      // PC端
-      if (window.location.href.includes("mobile/index.html#/")) {
-        window.location.href = window.location.href.replace("mobile/index.html#/", "index.html#/");
+      console.log('----------',window.location.href);
+      if (window.location.href.includes('en.capitalmuseum.org.cn')) {
+        // PC端
+        window.location.href = window.location.origin
         setTimeout(() => {
           location.reload(true);
-        }, 1000);
+        }, 200);
+
       }
     }
+
   }
 
 }
 </script>
 
 <style lang="less">
-#app{
+#app {
   max-width: 500px;
   margin: 0 auto;
 }

+ 2 - 1
webM/vue.config.js

@@ -1,3 +1,4 @@
 module.exports = {
-  publicPath: './'
+  publicPath: './',
+  productionSourceMap: false,
 }