From 4010ed6c23d081a2937d0fe1719414ba127b17a2 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: 星期一, 12 四月 2021 16:04:04 +0800 Subject: [PATCH] 统一axios写法 --- web_src/src/components/ParentPlatformList.vue | 46 ++++++++++++++++++++++++---------------------- 1 files changed, 24 insertions(+), 22 deletions(-) diff --git a/web_src/src/components/ParentPlatformList.vue b/web_src/src/components/ParentPlatformList.vue index ee0d342..9a525c6 100644 --- a/web_src/src/components/ParentPlatformList.vue +++ b/web_src/src/components/ParentPlatformList.vue @@ -121,20 +121,21 @@ }, deletePlatformCommit: function(platform) { var that = this; - that.$axios.delete(`/api/platform/delete/${platform.serverGBId}`) - .then(function (res) { - if (res.data == "success") { - that.$message({ - showClose: true, - message: '鍒犻櫎鎴愬姛', - type: 'success' - }); - that.initData() - } - }) - .catch(function (error) { - console.log(error); - }); + that.$axios({ + method: 'delete', + url:`/api/platform/delete/${platform.serverGBId}` + }).then(function (res) { + if (res.data == "success") { + that.$message({ + showClose: true, + message: '鍒犻櫎鎴愬姛', + type: 'success' + }); + that.initData() + } + }).catch(function (error) { + console.log(error); + }); }, chooseChannel: function(platform) { this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, ()=>{ @@ -155,14 +156,15 @@ getPlatformList: function() { let that = this; - this.$axios.get(`/api/platform/query/${that.count}/${that.currentPage}`) - .then(function (res) { - that.total = res.data.total; - that.platformList = res.data.list; - }) - .catch(function (error) { - console.log(error); - }); + this.$axios({ + method: 'get', + url:`/api/platform/query/${that.count}/${that.currentPage}` + }).then(function (res) { + that.total = res.data.total; + that.platformList = res.data.list; + }).catch(function (error) { + console.log(error); + }); } -- Gitblit v1.8.0