From a70e327a8efaf38d74911ea568419a087fbd235a Mon Sep 17 00:00:00 2001 From: lawrencehj <1934378145@qq.com> Date: 星期四, 15 四月 2021 11:42:05 +0800 Subject: [PATCH] 修改用户密码前先验证旧密码,增加安全性 --- web_src/src/components/dialog/platformEdit.vue | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index c3c5ac9..c0e0f9a 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -163,17 +163,17 @@ methods: { openDialog: function (platform, callback) { var that = this; - this.$axios - .get(`/api/platforms/serverconfig`) - .then(function (res) { + this.$axios({ + method: 'get', + url:`/api/platform/server_config` + }).then(function (res) { console.log(res); that.platform.deviceGBId = res.data.username; that.platform.deviceIp = res.data.deviceIp; that.platform.devicePort = res.data.devicePort; that.platform.username = res.data.username; that.platform.password = res.data.password; - }) - .catch(function (error) { + }).catch(function (error) { console.log(error); }); this.showDialog = true; @@ -188,11 +188,11 @@ onSubmit: function () { console.log("onSubmit"); var that = this; - that.$axios - .post(`/api/platforms/save`, that.platform) - .then(function (res) { - console.log(res); - console.log(res.data == "success"); + that.$axios({ + method: 'post', + url:`/api/platform/save`, + data: that.platform + }).then(function (res) { if (res.data == "success") { that.$message({ showClose: true, @@ -204,8 +204,7 @@ that.listChangeCallback(); } } - }) - .catch(function (error) { + }).catch(function (error) { console.log(error); }); }, @@ -218,8 +217,9 @@ deviceGBIdExit: async function (deviceGbId) { var result = false; var that = this; - await that.$axios - .post(`/api/platforms/exit/${deviceGbId}`) + await that.$axios({ + method: 'post', + url:`/api/platform/exit/${deviceGbId}`}) .then(function (res) { result = res.data; }) -- Gitblit v1.8.0