浏览代码

修改bug

修改bug
dangyunlong 1 月之前
父节点
当前提交
7f8fdaba54
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/views/news/creatNews.vue

+ 6 - 0
src/views/news/creatNews.vue

@@ -556,6 +556,9 @@ export default {
       if (this.form.commend_id != undefined && this.form.commend_id.length > 0) {
         this.form.commend_id = JSON.stringify(this.form.commend_id); // 提取推荐ID
       }
+      if (this.form.commend_id.length == 0) {
+        this.form.commend_id = '[]';
+      }
       //先进行验证
       console.log(this.form);
 
@@ -827,6 +830,9 @@ export default {
       if (this.form.commend_id != undefined && this.form.commend_id.length > 0) {
         this.form.commend_id = JSON.stringify(this.form.commend_id); // 提取推荐ID
       }
+      if (this.form.commend_id.length == 0) {
+        this.form.commend_id = '[]';
+      }
       //将department_id和city_id转换为字符串  
       // this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
       // this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);