From 46cf650a863f9181f78c09f9b1146972844449bc Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 21 一月 2022 18:00:15 +0800
Subject: [PATCH] 优化通道选择是通道的查询

---
 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