ソースを参照

默认路由指向index修改

wangtao 3 年 前
コミット
78393c1bad
4 ファイル変更39 行追加40 行削除
  1. 23 23
      src/api/system/notice.js
  2. 3 4
      src/router/index.js
  3. 12 12
      src/views/index.vue
  4. 1 1
      vue.config.js

+ 23 - 23
src/api/system/notice.js

@@ -2,43 +2,43 @@ import request from '@/utils/request'
 
 // 查询公告列表
 export function listNotice(query) {
-  return request({
-    url: '/system/notice/list',
-    method: 'get',
-    params: query
-  })
+    return request({
+        url: '/system/notice/list',
+        method: 'get',
+        params: query
+    })
 }
 
 // 查询公告详细
 export function getNotice(noticeId) {
-  return request({
-    url: '/system/notice/' + noticeId,
-    method: 'get'
-  })
+    return request({
+        url: '/system/notice/' + noticeId,
+        method: 'get'
+    })
 }
 
 // 新增公告
 export function addNotice(data) {
-  return request({
-    url: '/system/notice',
-    method: 'post',
-    data: data
-  })
+    return request({
+        url: '/system/notice',
+        method: 'post',
+        data: data
+    })
 }
 
 // 修改公告
 export function updateNotice(data) {
-  return request({
-    url: '/system/notice',
-    method: 'put',
-    data: data
-  })
+    return request({
+        url: '/system/notice',
+        method: 'put',
+        data: data
+    })
 }
 
 // 删除公告
 export function delNotice(noticeId) {
-  return request({
-    url: '/system/notice/' + noticeId,
-    method: 'delete'
-  })
+    return request({
+        url: '/system/notice/' + noticeId,
+        method: 'delete'
+    })
 }

+ 3 - 4
src/router/index.js

@@ -26,9 +26,8 @@ import Layout from '@/layout'
  */
 
 // 公共路由
-export const constantRoutes = [
-    {
-        path: '/index',
+export const constantRoutes = [{
+        path: '/',
         component: (resolve) => require(['@/views/index'], resolve),
         hidden: true
     },
@@ -61,7 +60,7 @@ export const constantRoutes = [
         component: (resolve) => require(['@/views/error/401'], resolve),
         hidden: true
     },
-    
+
 ]
 
 export default new Router({

+ 12 - 12
src/views/index.vue

@@ -84,13 +84,13 @@ export default {
 
     };
   },
- 
+
   created(){
     // setTimeout(() =>{
     //   console.log(12121212)
     //   this.postMsg3()
     // },30000)
-    
+
   },
   mounted(){
     let that = this;
@@ -174,7 +174,7 @@ export default {
       this.springFrameItem = {}
     },
     postMsg(value) {
-			var myframe = document.getElementById("iframe"); //获取iframe 
+			var myframe = document.getElementById("iframe"); //获取iframe
 			myframe.contentWindow.postMessage({  name: value }, "*"); //childDomain是子页面的源(协议+主机+端口号)
 		},
     postMsg2(value) {//视频
@@ -195,14 +195,14 @@ export default {
         }).catch(err =>{
         })
       }else if(value.unitType == "2"){
-        var myframe = document.getElementById("iframe"); //获取iframe 
+        var myframe = document.getElementById("iframe"); //获取iframe
 			  myframe.contentWindow.postMessage({  name: "打印机" }, "*"); //childDomain是子页面的源(协议+主机+端口号)
       }
-			// var myframe = document.getElementById("iframe"); //获取iframe 
+			// var myframe = document.getElementById("iframe"); //获取iframe
 			// myframe.contentWindow.postMessage({  name: '摄像头',id:value.id }, "*"); //childDomain是子页面的源(协议+主机+端口号)
 		},
     postMsg3(){//视频测试
-			var myframe = document.getElementById("iframe"); //获取iframe 
+			var myframe = document.getElementById("iframe"); //获取iframe
 			myframe.contentWindow.postMessage({  name: '摄像头',id:"1000002$1$0$7" }, "*"); //childDomain是子页面的源(协议+主机+端口号)
 		},
   },
@@ -251,8 +251,8 @@ export default {
             }
 
         }
-        
-      }  
+
+      }
       .rightWrap{
         position: absolute;
         z-index: 10;
@@ -265,7 +265,7 @@ export default {
           height:9.25925vh;
           padding:1.57407vh 30px;
           overflow: hidden;
-          
+
         }
         .leftR{
           width:449px;
@@ -276,7 +276,7 @@ export default {
           .iOTNetworkCard{
             height:550px;
           }
-          
+
         }
         .rightR{
           width:700px;
@@ -285,7 +285,7 @@ export default {
             height:267.8px;
           }
         }
-       
+
       }
     }
     .mt16{
@@ -332,7 +332,7 @@ export default {
   .title2{
     margin-bottom:15px;
   }
-  
+
 }
 .modular:nth-child(1){
   margin-top:0px;

+ 1 - 1
vue.config.js

@@ -125,4 +125,4 @@ module.exports = {
                 }
             )
     }
-}
+}