Browse Source

修改bug

Jing 1 week ago
parent
commit
1779a45e7d
1 changed files with 3 additions and 11 deletions
  1. 3 11
      src/views/news/creatNews.vue

+ 3 - 11
src/views/news/creatNews.vue

@@ -600,7 +600,8 @@ export default {
           if (formData.commend_id.length == 0) {
             formData.commend_id = '[]';
           }
-          this.$store.dispatch('news/addArticle', this.form).then(res => {
+
+          this.$store.dispatch('news/addArticle', formData).then(res => {
             if (res.code == 200) {
               //汇报结果
               this.$message({
@@ -1075,15 +1076,6 @@ export default {
     },
     //6.问卷 刘佳伟 end ------------------------------------------------------------>
   },
-  watch: {
-    '$route'(to, from) {
-      console.log(from, '---------------------------------------');
-      // 监听路由参数中的 id 变化,若变化则更新页面状态并获取数据
-      if (to.query.id) {
-        this.getMainData();
-      }
-    },
-  },
   mounted() {
     console.log("mounted")
     this.getNews()
@@ -1104,7 +1096,7 @@ export default {
       console.log("添加新闻!")
     }
   },
-}
+};
 </script>
 
 <style scoped lang="less">