Commit b0d0d30781a99e53f1a287cdb076da6871085029
1 parent
c9fd7f94
修改云端录像选择节点流媒体path不修改的bug
device表增加的mediaServerId字段丢失,重新添加
Showing
2 changed files
with
18 additions
and
5 deletions
sql/mysql.sql
| @@ -48,6 +48,7 @@ CREATE TABLE `device` ( | @@ -48,6 +48,7 @@ CREATE TABLE `device` ( | ||
| 48 | `ssrcCheck` int DEFAULT '0', | 48 | `ssrcCheck` int DEFAULT '0', |
| 49 | `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | 49 | `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 50 | `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | 50 | `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 51 | + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'auto', | ||
| 51 | `custom_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | 52 | `custom_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, |
| 52 | `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, | 53 | `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, |
| 53 | PRIMARY KEY (`id`), | 54 | PRIMARY KEY (`id`), |
web_src/src/components/CloudRecord.vue
| @@ -109,15 +109,26 @@ | @@ -109,15 +109,26 @@ | ||
| 109 | that.mediaServerList = data.data; | 109 | that.mediaServerList = data.data; |
| 110 | if (that.mediaServerList.length > 0) { | 110 | if (that.mediaServerList.length > 0) { |
| 111 | that.mediaServerId = that.mediaServerList[0].id | 111 | that.mediaServerId = that.mediaServerList[0].id |
| 112 | - let port = that.mediaServerList[0].httpPort; | ||
| 113 | - if (location.protocol === "https:" && that.mediaServerList[0].httpSSlPort) { | ||
| 114 | - port = that.mediaServerList[0].httpSSlPort | ||
| 115 | - } | ||
| 116 | - that.mediaServerPath = location.protocol + "//" + that.mediaServerList[0].streamIp + ":" + port | 112 | + that.setMediaServerPath(that.mediaServerId); |
| 117 | that.getRecordList(); | 113 | that.getRecordList(); |
| 118 | } | 114 | } |
| 119 | }) | 115 | }) |
| 120 | }, | 116 | }, |
| 117 | + setMediaServerPath: function (serverId) { | ||
| 118 | + let that = this; | ||
| 119 | + let i; | ||
| 120 | + for (i = 0; i < that.mediaServerList.length; i++) { | ||
| 121 | + if (serverId === that.mediaServerList[i].id) { | ||
| 122 | + break; | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | + let port = that.mediaServerList[i].httpPort; | ||
| 126 | + if (location.protocol === "https:" && that.mediaServerList[i].httpSSlPort) { | ||
| 127 | + port = that.mediaServerList[i].httpSSlPort | ||
| 128 | + } | ||
| 129 | + that.mediaServerPath = location.protocol + "//" + that.mediaServerList[i].streamIp + ":" + port | ||
| 130 | + console.log(that.mediaServerPath) | ||
| 131 | + }, | ||
| 121 | getRecordList: function (){ | 132 | getRecordList: function (){ |
| 122 | let that = this; | 133 | let that = this; |
| 123 | this.$axios({ | 134 | this.$axios({ |
| @@ -146,6 +157,7 @@ | @@ -146,6 +157,7 @@ | ||
| 146 | console.log(val) | 157 | console.log(val) |
| 147 | this.total = 0; | 158 | this.total = 0; |
| 148 | this.recordList = []; | 159 | this.recordList = []; |
| 160 | + this.setMediaServerPath(val); | ||
| 149 | this.getRecordList(); | 161 | this.getRecordList(); |
| 150 | }, | 162 | }, |
| 151 | showRecordDetail(row){ | 163 | showRecordDetail(row){ |