规范化api, 进行中。。。
This commit is contained in:
@@ -121,7 +121,7 @@ export default {
|
||||
},
|
||||
deletePlatformCommit: function(platform) {
|
||||
var that = this;
|
||||
that.$axios.post(`/api/platforms/delete`, platform)
|
||||
that.$axios.delete(`/api/platform/delete/${platform.serverGBId}`)
|
||||
.then(function (res) {
|
||||
if (res.data == "success") {
|
||||
that.$message({
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
getPlatformList: function() {
|
||||
let that = this;
|
||||
|
||||
this.$axios.get(`/api/platforms/${that.count}/${that.currentPage}`)
|
||||
this.$axios.get(`/api/platform/query/${that.count}/${that.currentPage}`)
|
||||
.then(function (res) {
|
||||
that.total = res.data.total;
|
||||
that.platformList = res.data.list;
|
||||
|
||||
@@ -171,7 +171,7 @@ export default {
|
||||
this.endTime = null;
|
||||
}
|
||||
let self = this;
|
||||
this.$axios.get(`/api/positions/${this.deviceId}/history`, {
|
||||
this.$axios.get(`/api/position/history/${this.deviceId}`, {
|
||||
params: {
|
||||
start: self.startTime,
|
||||
end: self.endTime,
|
||||
@@ -202,7 +202,7 @@ export default {
|
||||
this.mapPointList = [];
|
||||
this.mobilePositionList = [];
|
||||
let self = this;
|
||||
this.$axios.get(`/api/positions/${this.deviceId}/latest`)
|
||||
this.$axios.get(`/api/position/latest/${this.deviceId}`)
|
||||
.then(function (res) {
|
||||
console.log(res.data);
|
||||
self.total = res.data.length;
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
},
|
||||
subscribeMobilePosition: function() {
|
||||
let self = this;
|
||||
this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, {
|
||||
this.$axios.get(`/api/position/subscribe/${this.deviceId}`, {
|
||||
params: {
|
||||
expires: self.expired,
|
||||
interval: self.interval,
|
||||
@@ -241,7 +241,7 @@ export default {
|
||||
},
|
||||
unSubscribeMobilePosition: function() {
|
||||
let self = this;
|
||||
this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, {
|
||||
this.$axios.get(`/api/position/subscribe/${this.deviceId}`, {
|
||||
params: {
|
||||
expires: 0,
|
||||
interval: self.interval,
|
||||
|
||||
@@ -176,7 +176,7 @@ export default {
|
||||
var result = false;
|
||||
var that = this;
|
||||
await that.$axios
|
||||
.post(`/api/platforms/exit/${deviceGbId}`)
|
||||
.post(`/api/platform/exit/${deviceGbId}`)
|
||||
.then(function (res) {
|
||||
result = res.data;
|
||||
})
|
||||
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
var result = false;
|
||||
var that = this;
|
||||
await that.$axios
|
||||
.post(`/api/platforms/exit/${deviceGbId}`)
|
||||
.post(`/api/platform/exit/${deviceGbId}`)
|
||||
.then(function (res) {
|
||||
result = res.data;
|
||||
})
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
|
||||
this.$axios({
|
||||
method:"post",
|
||||
url:"/api/platforms/updateChannelForGB",
|
||||
url:"/api/platform/update_channel_for_gb",
|
||||
data:{
|
||||
platformId: that.platformId,
|
||||
channelReduces: that.chooseData
|
||||
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
if (Object.keys(addData).length >0) {
|
||||
that.$axios({
|
||||
method:"post",
|
||||
url:"/api/platforms/updateChannelForGB",
|
||||
url:"/api/platform/update_channel_for_gb",
|
||||
data:{
|
||||
platformId: that.platformId,
|
||||
channelReduces: addData
|
||||
@@ -162,8 +162,8 @@ export default {
|
||||
}
|
||||
if (Object.keys(delData).length >0) {
|
||||
that.$axios({
|
||||
method:"post",
|
||||
url:"/api/platforms/delChannelForGB",
|
||||
method:"delete",
|
||||
url:"/api/platform/del_channel_for_gb",
|
||||
data:{
|
||||
platformId: that.platformId,
|
||||
channelReduces: delData
|
||||
@@ -182,7 +182,7 @@ export default {
|
||||
getChannelList: function () {
|
||||
let that = this;
|
||||
|
||||
this.$axios.get(`/api/platforms/channelList`, {
|
||||
this.$axios.get(`/api/platform/channel_list`, {
|
||||
params: {
|
||||
page: that.currentPage,
|
||||
count: that.count,
|
||||
|
||||
@@ -142,7 +142,7 @@ export default {
|
||||
if (Object.keys(delData).length >0) {
|
||||
console.log(delData)
|
||||
that.$axios({
|
||||
method:"post",
|
||||
method:"delete",
|
||||
url:"/api/gbStream/del",
|
||||
data:{
|
||||
gbStreams: delData,
|
||||
@@ -152,6 +152,7 @@ export default {
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
openDialog: function (platform, callback) {
|
||||
var that = this;
|
||||
this.$axios
|
||||
.get(`/api/platforms/serverconfig`)
|
||||
.get(`/api/platform/server_config`)
|
||||
.then(function (res) {
|
||||
console.log(res);
|
||||
that.platform.deviceGBId = res.data.username;
|
||||
@@ -189,7 +189,7 @@ export default {
|
||||
console.log("onSubmit");
|
||||
var that = this;
|
||||
that.$axios
|
||||
.post(`/api/platforms/save`, that.platform)
|
||||
.post(`/api/platform/save`, that.platform)
|
||||
.then(function (res) {
|
||||
console.log(res);
|
||||
console.log(res.data == "success");
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
var result = false;
|
||||
var that = this;
|
||||
await that.$axios
|
||||
.post(`/api/platforms/exit/${deviceGbId}`)
|
||||
.post(`/api/platform/exit/${deviceGbId}`)
|
||||
.then(function (res) {
|
||||
result = res.data;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user