Parcourir la source

'202203091406'

fanghuisheng il y a 3 ans
Parent
commit
c131f917df
6 fichiers modifiés avec 33 ajouts et 28 suppressions
  1. 2 8
      public/static/config.js
  2. 8 2
      src/main.js
  3. 18 17
      src/router/index.js
  4. 5 1
      src/views/login.vue
  5. BIN
      正式.zip
  6. BIN
      测试.zip

+ 2 - 8
public/static/config.js

@@ -3,8 +3,8 @@ var PLATFROM_CONFIG = {};
 // PLATFROM_CONFIG.baseUrl = "http://172.16.120.104:8010/" //杨强本地
 // PLATFROM_CONFIG.baseUrl = "http://172.16.1.196:8010/"  //超博本地
 
-console.log(window.location.host)
-if (window.location.host.indexOf("localhost") != -1) {
+// console.log(window.location)
+if (window.location.host.indexOf("localhost") != -1 || window.location.host.indexOf("pcdev.ewoogi.com") != -1) {
     PLATFROM_CONFIG.baseUrl = "https://qhome.usky.cn/fivapi/" //线上
     PLATFROM_CONFIG.fileUrl = "https://qhome.usky.cn/file/" //xlsx文件访问路径
 } else {
@@ -18,12 +18,6 @@ PLATFROM_CONFIG.Interface = "/vuefiv/InterfaceReturn.json"
 PLATFROM_CONFIG.ione = "/vuefiv/1.json"
 
 
-
-// 当前站点 siteId 信息存储
-// var PLATFROM_SITEID = {};
-// PLATFROM_SITEID.id = 0;
-
-
 //alarming WEBSOCKET
 // let userInfo = window.localStorage.getItem("key");
 // var PLATFROM_WEBSOCKET = {};

+ 8 - 2
src/main.js

@@ -54,8 +54,9 @@ router.beforeEach((to, from, next) => {
             // console.log(window.location.host.indexOf("localhost") != -1)
             if (window.location.host.indexOf("localhost") != -1) {
                 next({ path: '/' })
+            } else if (window.location.host.indexOf("pcdev.ewoogi.com") != -1) {
+                window.location.href = 'https://pcdev.ewoogi.com/adminfiv/#/login'
             } else {
-                //https://wx.ewoogi.com/adminfiv/#/login
                 window.location.href = 'https://wx.ewoogi.com/manage/#/login'
             }
 
@@ -74,6 +75,11 @@ router.beforeEach((to, from, next) => {
     } else {
         document.getElementById('routers').style.display = "block"
         //路由的next必须存在,否则无法进入下一页
-        next()
+        if (localStorage.getItem('accessToken') === null) {
+            next({ path: '/home' })
+        } else {
+            next()
+        }
+
     }
 })

+ 18 - 17
src/router/index.js

@@ -12,7 +12,7 @@ let routes = [
         name: 'login',
         meta: { title: '登录', name: "登录 ", type: "" },
         component: () =>
-            import ('../views/login.vue'),
+            import('../views/login.vue'),
         hidden: true,
     },
     {
@@ -20,7 +20,7 @@ let routes = [
         name: 'home',
         meta: { title: '首页', name: "智慧用电监控平台", type: "index" },
         component: () =>
-            import ('../views/home/index.vue'),
+            import('../views/home/index.vue'),
     },
 
     // ming router end
@@ -55,7 +55,16 @@ let routes = [
         name: 'overview',
         meta: { title: '概览', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Overview.vue'),
+            import('../views/site/Overview.vue'),
+    },
+    //配电系统图页面
+    {
+        path: '/Power_diagram',
+        name: 'power_diagram',
+        meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
+        component: () =>
+            import('../views/site/Power_diagram.vue'),
+        // import ('../views/site/CircuitEdit.vue'),
     },
     //配电系统图页面
     {
@@ -63,7 +72,7 @@ let routes = [
         name: 'CircuitEdit',
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/CircuitEdit.vue'),
+            import('../views/site/CircuitEdit.vue'),
     },
 
     //设备监控页面
@@ -72,7 +81,7 @@ let routes = [
         name: 'device_motore',
         meta: { title: '设备监控', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Device_motore.vue'),
+            import('../views/site/Device_motore.vue'),
     },
     //事件告警页面
     {
@@ -80,26 +89,18 @@ let routes = [
         name: 'event_alarm',
         meta: { title: '事件告警', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Event_alarm.vue'),
+            import('../views/site/Event_alarm.vue'),
     },
 
 
-    //配电系统图页面
-    {
-        path: '/Power_diagram',
-        name: 'power_diagram',
-        meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
-        component: () =>
-            import ('../views/site/Power_diagram.vue'),
-        // import ('../views/site/CircuitEdit.vue'),
-    },
+
     // 编辑器页面
     {
         path: '/CircuitEdit1',
         name: 'CircuitEdit1',
         meta: { title: '编辑器', name: "测试站点一", type: "" },
         component: () =>
-            import ('../views/CircuitEdit1.vue'),
+            import('../views/CircuitEdit1.vue'),
     },
     // 预览页页面
     {
@@ -108,7 +109,7 @@ let routes = [
         meta: { title: '预览', name: "测试站点一", type: "" },
         component: () =>
             // import('../views/CircuitPreview.vue'),
-            import ('../views/CircuitPreview.vue'),
+            import('../views/CircuitPreview.vue'),
         // import('../views/site/Power_diagram.vue'),
     },
 

+ 5 - 1
src/views/login.vue

@@ -84,7 +84,11 @@ export default {
   },
   mounted() {
     this.getCookie();
-    this.loginFree();
+    if (window.location.host.indexOf("localhost") != -1) {
+      this.loginFree();
+    } else {
+      this.$router.push({ path: "/home" });
+    }
   },
 
   methods: {

BIN
正式.zip


BIN
dist.zip → 测试.zip