Explorar el Código

增加server字段

asd123a20 hace 2 años
padre
commit
5d6eb473b3
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      service-cms/app/service/content.js

+ 5 - 5
service-cms/app/service/content.js

@@ -9,27 +9,27 @@ class ContentService extends Service {
     this.model = this.ctx.model.Content;
     this.menuModel = this.ctx.model.Menu;
   }
-  async create({ title, describe, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle }) {
+  async create({ title, describe, source, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle }) {
     assert(title, '标题不存在');
-    assert(describe, '描述不存在');
+    // assert(describe, '描述不存在');
     assert(content, '内容不存在');
     assert(bind, '绑定栏目不存在');
     try {
       const createAt = moment().format('x');
       const updateAt = moment().format('x');
-      const item = await this.model.create({ title, describe, content, bind, istop, date, thumbnail, recommend, annex, createAt, updateAt, keywords, svip, isShow, status, curtTitle });
+      const item = await this.model.create({ title, describe, source, content, bind, istop, date, thumbnail, recommend, annex, createAt, updateAt, keywords, svip, isShow, status, curtTitle });
       return { errcode: 0, errmsg: '', data: item };
     } catch (error) {
       throw error;
     }
   }
-  async update({ id, title, describe, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle }) {
+  async update({ id, title, describe, source, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle }) {
     assert(id, 'id不存在');
     try {
       const res = await this.model.findOne({ _id: id });
       if (!res) return { errcode: -1001, errmsg: '数据不存在', data: '' };
       const updateAt = moment().format('x');
-      await this.model.updateOne({ _id: id }, { title, describe, content, bind, istop, date, thumbnail, recommend, annex, updateAt, keywords, svip, isShow, status, curtTitle });
+      await this.model.updateOne({ _id: id }, { title, describe, source, content, bind, istop, date, thumbnail, recommend, annex, updateAt, keywords, svip, isShow, status, curtTitle });
       return { errcode: 0, errmsg: '', data: 'update' };
     } catch (error) {
       throw error;