李楠 пре 4 година
родитељ
комит
3cb28f6b0c
1 измењених фајлова са 11 додато и 19 уклоњено
  1. 11 19
      src/views/systemConfig/ConfigManage.vue

+ 11 - 19
src/views/systemConfig/ConfigManage.vue

@@ -149,6 +149,7 @@
 
 <script>
 import { mapActions } from "vuex";
+import axios from 'axios'
 export default {
     name: "ConfigManage",
     data() {
@@ -172,12 +173,10 @@ export default {
     },
     created() {
         this.loadList();
-        this.fetch({
-                api: "/getfengdundata/dataSource/update",
-                success: (res) => {
-                    this.value1 = res.msg == "true" ? true : false
-                },
-            });
+        axios.get('http://119.3.93.18:8087/dataSource/update').then(res => {
+            console.log(res.data)
+            this.value1 = res.data.msg == "true" ? true : false
+        })
     },
     methods: {
         ...mapActions(["fetch"]),
@@ -190,7 +189,6 @@ export default {
             });
         },
         handleShow(row) {
-            console.log(row);
             this.configInfo = JSON.parse(row.conf.data);
             this.dialogConfig = true;
         },
@@ -263,18 +261,12 @@ export default {
             ];
         },
         switchChange(val) {
-            console.log(val)
-            this.fetch({
-                api: "/getfengdundata/dataSource/update",
-                data: {flag: val},
-                success: (res) => {
-                    this.$message.success(`修改为${val?"“丰顿数据”":"“配置数据”"}成功!`)
-                },
-                fail: (err) => {
-                    this.$message.error(`修改为${val?"丰顿数据":"配置数据"}失败!`)
-                    this.value1 = !val
-                },
-            });
+            axios.get('http://119.3.93.18:8087/dataSource/update',{params: {flag: val}}).then(res => {
+                this.$message.success(`修改为${val?"“丰顿数据”":"“配置数据”"}成功!`)
+            }).catch((err) => {
+                this.$message.error(`修改为${val?"丰顿数据":"配置数据"}失败!`)
+                this.value1 = !val
+            })
         },
         // 配置项增加
         plus() {