规范化api, 进行中。。。

This commit is contained in:
panlinlin
2021-04-07 18:35:13 +08:00
parent c7b2004e43
commit 2310087e03
14 changed files with 321 additions and 76 deletions

View File

@@ -136,7 +136,7 @@
getDeviceList: function() {
let that = this;
this.getDeviceListLoading = true;
this.$axios.get(`/api/devices`,{
this.$axios.get(`/api/device/query/devices`,{
params: {
page: that.currentPage,
count: that.count
@@ -167,13 +167,12 @@
//gb28181平台对接
//刷新设备信息
refDevice: function(itemData) {
///api/devices/{deviceId}/sync
console.log("刷新对应设备:" + itemData.deviceId);
var that = this;
that.$refs[itemData.deviceId + 'refbtn' ].loading = true;
this.$axios({
method: 'post',
url: '/api/devices/' + itemData.deviceId + '/sync'
url: '/api/device/query/devices/' + itemData.deviceId + '/sync'
}).then(function(res) {
console.log("刷新设备结果:"+JSON.stringify(res));
if (!res.data.deviceId) {
@@ -217,7 +216,7 @@
let that = this;
this.$axios({
method: 'get',
url: '/api/devices/' + row.deviceId + '/transport/' + row.streamMode
url: '/api/device/query/transport' + row.deviceId + '/' + row.streamMode
}).then(function(res) {
}).catch(function(e) {

View File

@@ -154,7 +154,7 @@ export default {
getDeviceChannelList: function () {
let that = this;
this.$axios.get(`/api/devices/${this.$route.params.deviceId}/channels`, {
this.$axios.get(`/api/device/query/devices/${this.$route.params.deviceId}/channels`, {
params: {
page: that.currentPage,
count: that.count,
@@ -188,7 +188,7 @@ export default {
let that = this;
this.$axios({
method: 'get',
url: '/api/play/' + deviceId + '/' + channelId
url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) {
console.log(res.data)
let streamId = res.data.streamId;
@@ -216,7 +216,7 @@ export default {
var that = this;
this.$axios({
method: 'post',
url: '/api/play/' + itemData.streamId + '/stop'
url: '/api/play/stop/' + itemData.streamId
}).then(function (res) {
console.log(JSON.stringify(res));
that.initData();
@@ -251,7 +251,7 @@ export default {
showSubchannels: function (channelId) {
let that = this;
this.$axios.get(`/api/subChannels/${this.deviceId}/${this.parentChannelId}/channels`, {
this.$axios.get(`/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, {
params: {
page: that.currentPage,
count: that.count,
@@ -282,7 +282,7 @@ export default {
console.log(row)
this.$axios({
method: 'post',
url: `/api/channel/update/${this.deviceId}`,
url: `/api/device/query/channel/update/${this.deviceId}`,
params: row
}).then(function (res) {
console.log(JSON.stringify(res));

View File

@@ -261,7 +261,7 @@ export default {
this.$refs.videoPlayer.pause()
that.$axios({
method: 'post',
url: '/api/play/' + that.streamId + '/convert'
url: '/api/play/convert/' + that.streamId
}).then(function (res) {
if (res.data.code == 0) {
that.convertKey = res.data.key;
@@ -298,7 +298,7 @@ export default {
that.$refs.videoPlayer.pause()
this.$axios({
method: 'post',
url: '/api/play/convert/stop/' + this.convertKey
url: '/api/play/convertStop/' + this.convertKey
}).then(function (res) {
if (res.data.code == 0) {
console.log(res.data.msg)
@@ -393,7 +393,7 @@ export default {
} else {
this.$axios({
method: 'get',
url: '/api/playback/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
row.endTime
}).then(function (res) {
var streamInfo = res.data;
@@ -408,7 +408,7 @@ export default {
this.videoUrl = '';
this.$axios({
method: 'get',
url: '/api/playback/' + this.streamId + '/stop'
url: '/api/playback/stop/' + this.streamId
}).then(function (res) {
if (callback) callback()
});