From 8f9a53029632f258bbafa8f6dc2c896759206695 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 02 三月 2022 09:22:20 +0800
Subject: [PATCH] Merge pull request #360 from TristingChen/alarm-test
---
web_src/src/components/dialog/platformEdit.vue | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue
index 62a6957..38a2aef 100644
--- a/web_src/src/components/dialog/platformEdit.vue
+++ b/web_src/src/components/dialog/platformEdit.vue
@@ -116,6 +116,7 @@
showDialog: false,
isLoging: false,
onSubmit_text: "绔嬪嵆鍒涘缓",
+ saveUrl: "/api/platform/save",
platform: {
id: null,
@@ -163,6 +164,7 @@
var that = this;
if (platform == null) {
this.onSubmit_text = "绔嬪嵆鍒涘缓";
+ this.saveUrl = "/api/platform/add";
this.$axios({
method: 'get',
url:`/api/platform/server_config`
@@ -198,6 +200,7 @@
this.platform.shareAllLiveStream = platform.shareAllLiveStream;
this.platform.catalogId = platform.catalogId;
this.onSubmit_text = "淇濆瓨";
+ this.saveUrl = "/api/platform/save";
}
this.showDialog = true;
this.listChangeCallback = callback;
@@ -212,14 +215,13 @@
this.platform.username = this.platform.deviceGBId ;
},
onSubmit: function () {
- console.log("onSubmit");
var that = this;
that.$axios({
method: 'post',
- url:`/api/platform/save`,
+ url: this.saveUrl,
data: that.platform
}).then(function (res) {
- if (res.data == "success") {
+ if (res.data.code === 0) {
that.$message({
showClose: true,
message: "淇濆瓨鎴愬姛",
@@ -229,6 +231,12 @@
if (that.listChangeCallback != null) {
that.listChangeCallback();
}
+ }else {
+ that.$message({
+ showClose: true,
+ message: res.data.msg,
+ type: "error",
+ });
}
}).catch(function (error) {
console.log(error);
--
Gitblit v1.8.0