kkkkk преди 5 години
родител
ревизия
5da706ad1e
променени са 2 файла, в които са добавени 13 реда и са изтрити 16 реда
  1. 7 5
      global.js
  2. 6 11
      src/components/videoList.vue

+ 7 - 5
global.js

@@ -1,14 +1,16 @@
-const serverip="172.16.63.208"
-const host = 'http://' + serverip + '/index/api';
-const secret = '035c73f7-bb6b-4889-a715-d9eb2d1925cc';
+const serverip="218.59.173.214:8081"
+const host = 'http://' + serverip;
 const baseMediaUrl='ws://' + serverip + '/';
 function genApiUrl(method){
-	return host+method+"?secret="+secret;
+	return host+method;
+}
+function genGb28181Url(method){
+	return host+method;
 }
 export default{
 	serverip,
     host,
-    secret,
 	genApiUrl,
+	genGb28181Url,
 	baseMediaUrl
 }

+ 6 - 11
src/components/videoList.vue

@@ -122,7 +122,6 @@
 </template>
 
 <script>
-	import falsificationdata from '../../FalsificationData.js'
 	export default {
 		name: 'app',
 		components: {},
@@ -191,12 +190,9 @@
 					method: 'get',
 					url: this.$global.genApiUrl('/api/devices')
 				}).then(function(res) {
-					if (res.data.code == 0) {
-						that.deviceList = res.data;
-					}
+					that.deviceList = res.data;
 				}).catch(function(error) {
 					console.log("请求失败,使用假数据");
-					that.deviceList = falsificationdata.devices;
 				});
 			},
 			showVideoInfo: function(videoData) {
@@ -361,10 +357,10 @@
 				///api/devices/{deviceId}/sync
 				console.log("刷新对应设备:" + itemData.deviceId);
 				this.$axios({
-					method: 'get',
-					url: '/api/devices/' + itemData.deviceId + '/sync'
+					method: 'post',
+					url: this.$global.genGb28181Url('/api/devices/' + itemData.deviceId + '/sync')
 				}).then(function(res) {
-
+					// console.log("刷新设备结果:"+JSON.stringify(res));
 				});
 			},
 			//通知设备上传媒体流
@@ -372,12 +368,11 @@
 				///api/play/{deviceId}/{channelId}
 				let deviceId=this.currentDevice.deviceId;
 				let channelId=itemData.channelId;
-				console.log("通知设备推流:"+deviceId+" : "+channelId);
+				console.log("通知设备推流1:"+deviceId+" : "+channelId);
 				this.$axios({
 					method: 'get',
-					url: '/api/play/'+deviceId+'/'+channelId
+					url: this.$global.genGb28181Url('/api/play/'+deviceId+'/'+channelId)
 				}).then(function(res) {
-				
 				});
 			}