Преглед на файлове

修改二级标题必填

asd123a20 преди 1 година
родител
ревизия
f86da09990

+ 2 - 0
service-cms/app/model/content.js

@@ -13,6 +13,8 @@ const SchemaDefine = {
   thumbnail: { type: String, required: false },
   // 标题
   title: { type: String, required: true },
+  // 二级标题
+  twoTitle: { type: String, required: false },
   // 描述
   describe: { type: String, required: false },
   // 来源

+ 2 - 0
service-cms/app/model/imgnews.js

@@ -21,6 +21,8 @@ const SchemaDefine = {
   content: { type: String, required: false },
   // 标题
   title: { type: String, required: true },
+  // 二级标题
+  twoTitle: { type: String, required: true },
   // 是否显示
   isshow: { type: Boolean, required: false },
 };

+ 2 - 0
service-cms/app/model/menu.js

@@ -19,6 +19,8 @@ const SchemaDefine = {
   parentCode: { type: String, required: false },
   // 是否显示
   isshow: { type: Boolean, required: false },
+  // 模板
+  template: { type: String, required: false },
 };
 const schema = new Schema(SchemaDefine);
 module.exports = app => {

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

@@ -9,7 +9,7 @@ class ContentService extends Service {
     this.model = this.ctx.model.Content;
     this.menuModel = this.ctx.model.Menu;
   }
-  async create({ title, describe, source, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle, author }) {
+  async create({ title, describe, source, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle, author, twoTitle }) {
     assert(title, '标题不存在');
     // assert(describe, '描述不存在');
     assert(content, '内容不存在');
@@ -17,19 +17,19 @@ class ContentService extends Service {
     try {
       const createAt = moment().format('x');
       const updateAt = moment().format('x');
-      const item = await this.model.create({ title, describe, author, source, content, bind, istop, date, thumbnail, recommend, annex, createAt, updateAt, keywords, svip, isShow, status, curtTitle });
+      const item = await this.model.create({ title, twoTitle, describe, author, 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, author, source, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle }) {
+  async update({ id, title, describe, author, source, content, bind, istop, date, thumbnail, recommend, annex, keywords, svip, isShow, status, curtTitle, twoTitle }) {
     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, author, source, content, bind, istop, date, thumbnail, recommend, annex, updateAt, keywords, svip, isShow, status, curtTitle });
+      await this.model.updateOne({ _id: id }, { title, twoTitle, describe, author, source, content, bind, istop, date, thumbnail, recommend, annex, updateAt, keywords, svip, isShow, status, curtTitle });
       return { errcode: 0, errmsg: '', data: 'update' };
     } catch (error) {
       throw error;
@@ -46,7 +46,7 @@ class ContentService extends Service {
       throw error;
     }
   }
-  async query({ skip, limit, title, date, bind, keywords, svip, isShow, status, istop, parentCode, recommend }) {
+  async query({ skip, limit, title, date, bind, keywords, svip, isShow, status, istop, parentCode, recommend, twoTitle }) {
     if (parentCode) {
       const menus = await this.service.menu.menuList({ code: parentCode });
       const filter = { bind: { $in: menus } };
@@ -59,7 +59,7 @@ class ContentService extends Service {
     }
 
     const filter = {};
-    const arr = { title, date, keywords, svip, isShow, status, istop };
+    const arr = { title, date, keywords, svip, isShow, status, istop, twoTitle };
     for (const e in arr) {
       let datas;
       if (e === 'keywords') {

+ 6 - 5
service-cms/app/service/imgnews.js

@@ -10,26 +10,26 @@ class ImgnewsService extends Service {
     this.column = this.ctx.model.Column;
     this.pages = this.ctx.model.Pages;
   }
-  async create({ type, bind, date, img, url, content, describe, title, isshow }) {
+  async create({ type, bind, date, img, url, content, describe, title, isshow, twoTitle }) {
     assert(bind, '绑定类型不存在');
     // assert(img, '图片不存在');
     assert(title, '标题不存在');
     try {
       const createAt = moment().format('x');
       const updateAt = moment().format('x');
-      const item = await this.model.create({ title, type, bind, date, img, url, content, describe, createAt, updateAt, isshow });
+      const item = await this.model.create({ title, type, bind, date, img, url, content, describe, createAt, updateAt, isshow, twoTitle });
       return { errcode: 0, errmsg: '', data: item };
     } catch (error) {
       throw error;
     }
   }
-  async update({ id, type, bind, date, img, url, content, describe, title, isshow }) {
+  async update({ id, type, bind, date, img, url, content, describe, title, isshow, twoTitle }) {
     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, type, bind, date, img, url, content, describe, updateAt, isshow });
+      await this.model.updateOne({ _id: id }, { title, type, bind, date, img, url, content, describe, updateAt, isshow, twoTitle });
       return { errcode: 0, errmsg: '', data: 'update' };
     } catch (error) {
       throw error;
@@ -46,10 +46,11 @@ class ImgnewsService extends Service {
       throw error;
     }
   }
-  async query({ skip, limit, title, date, bind, isshow }) {
+  async query({ skip, limit, title, date, bind, isshow, twoTitle }) {
     const filter = {};
     if (title || date) filter.$or = [];
     if (title) filter.$or.push({ code: { $regex: title } });
+    if (twoTitle) filter.$or.push({ code: { $regex: twoTitle } });
     if (date) filter.$or.push({ date: { $regex: date } });
     if (bind) filter.bind = bind;
     if (isshow) filter.isshow = isshow;

+ 4 - 4
service-cms/app/service/menu.js

@@ -9,25 +9,25 @@ class MenuService extends Service {
     this.column = this.ctx.model.Column;
     this.pages = this.ctx.model.Pages;
   }
-  async create({ name, code, date, type, url, column, pages, parentCode, isshow }) {
+  async create({ name, code, date, type, url, column, pages, parentCode, isshow, template }) {
     assert(name, '名称不存在');
     assert(code, '编码不存在');
     assert(type, '类型不存在');
     try {
       const res = await this.model.findOne({ code });
       if (res) return { errcode: -1001, errmsg: '编码已存在', data: '' };
-      const item = await this.model.create({ name, code, date, type, url, column, pages, parentCode, isshow });
+      const item = await this.model.create({ name, code, date, type, url, column, pages, parentCode, isshow, template });
       return { errcode: 0, errmsg: '', data: item };
     } catch (error) {
       throw error;
     }
   }
-  async update({ id, name, date, type, url, column, pages, parentCode, isshow }) {
+  async update({ id, name, date, type, url, column, pages, parentCode, isshow, template }) {
     assert(id, 'id不存在');
     try {
       const res = await this.model.findOne({ _id: id });
       if (!res) return { errcode: -1001, errmsg: '数据不存在', data: '' };
-      await this.model.updateOne({ _id: id }, { name, date, type, url, column, pages, parentCode, isshow });
+      await this.model.updateOne({ _id: id }, { name, date, type, url, column, pages, parentCode, isshow, template });
       return { errcode: 0, errmsg: '', data: 'update' };
     } catch (error) {
       throw error;

+ 7 - 7
service-cms/config/config.default.js

@@ -36,14 +36,14 @@ module.exports = appInfo => {
   };
   // 数据库配置
   config.mongoose = {
-    url: 'mongodb://127.0.0.1/Microservices',
-    // url: 'mongodb://172.17.116.7/Microservices',
+    // url: 'mongodb://127.0.0.1:27018/Microservices',
+    url: 'mongodb://172.17.116.7:27018/Microservices',
     options: {
-      // user: 'root',
-      // pass: 'Ziyouyanfa#@!',
-      // authSource: 'admin',
-      // useNewUrlParser: true,
-      // useCreateIndex: true,
+      user: 'root',
+      pass: 'cms@cc-lotus',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
     },
   };
   return {

+ 1 - 1
service-cms/ecosystem.config.js

@@ -1,6 +1,6 @@
 'use strict';
 
-const app = 'service-cms';
+const app = 'skl-cms';
 module.exports = {
   apps: [{
     name: app, // 应用名称

+ 7 - 6
service-code/config/config.default.js

@@ -35,13 +35,14 @@ module.exports = appInfo => {
   };
   // 数据库配置
   config.mongoose = {
-    url: 'mongodb://127.0.0.1/Microservices',
+    // url: 'mongodb://127.0.0.1:27018/Microservices',
+    url: 'mongodb://172.17.116.7:27018/Microservices',
     options: {
-      // user: 'root',
-      // pass: 'Ziyouyanfa#@!',
-      // authSource: 'admin',
-      // useNewUrlParser: true,
-      // useCreateIndex: true,
+      user: 'root',
+      pass: 'cms@cc-lotus',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
     },
   };
   config.logger = {

+ 1 - 1
service-code/ecosystem.config.js

@@ -1,6 +1,6 @@
 'use strict';
 
-const app = 'service-code';
+const app = 'skl-code';
 module.exports = {
   apps: [{
     name: app, // 应用名称

+ 9 - 8
service-files/config/config.default.js

@@ -1,4 +1,4 @@
-/* eslint valid-jsdoc: "off" */
+/* eslint valid-jsdoc: 'off' */
 
 'use strict';
 /**
@@ -37,13 +37,14 @@ module.exports = appInfo => {
   };
   // 数据库配置
   config.mongoose = {
-    url: 'mongodb://127.0.0.1/Microservices',
+    // url: 'mongodb://127.0.0.1:27018/Microservices',
+    url: 'mongodb://172.17.116.7:27018/Microservices',
     options: {
-      // user: 'root',
-      // pass: 'Ziyouyanfa#@!',
-      // authSource: 'admin',
-      // useNewUrlParser: true,
-      // useCreateIndex: true,
+      user: 'root',
+      pass: 'cms@cc-lotus',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
     },
   };
   // 文件存储路径
@@ -55,7 +56,7 @@ module.exports = appInfo => {
   config.multipart = {
     mode: 'stream',
     fileSize: '5mb',
-    fileExtensions: [ '.zip', '.doc', '.docx', '.xlsx', '.xls' ], // 新增允许接收的文件后缀
+    fileExtensions: [ '.rtf', '.csv', '.odp', '.csv', '.ods', '.pptx', '.ppt', '.rar', '.7z', '.tar', '.gz', '.tar', '.gz', '.zip', '.doc', '.docx', '.xlsx', '.xls', '.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.tiff', '.pdf', '.txt', '.mp4', '.avi', '.mov', '.wmv', '.flv', '.mkv', '.m4v' ], // 新增允许接收的文件后缀
     // whitelist: [], // 覆盖允许接收的文件后缀
   };
   config.logger = {

+ 1 - 1
service-files/ecosystem.config.js

@@ -1,6 +1,6 @@
 'use strict';
 
-const app = 'service-files';
+const app = 'skl-files';
 module.exports = {
   apps: [{
     name: app, // 应用名称

+ 2 - 2
service-gateway/config/config.default.js

@@ -14,7 +14,7 @@ const naf = require('./naf');
  */
 module.exports = appInfo => {
   /**
-   * built-in config
+   * built-in configlo
    * @type {Egg.EggAppConfig}
    **/
   const config = exports = {};
@@ -53,7 +53,7 @@ module.exports = appInfo => {
   config.multipart = {
     mode: 'stream',
     fileSize: '5mb',
-    fileExtensions: [ '.zip', '.doc', '.docx', '.xlsx', '.xls' ], // 新增允许接收的文件后缀
+    fileExtensions: [ '.rtf', '.csv', '.odp', '.csv', '.ods', '.pptx', '.ppt', '.rar', '.7z', '.tar', '.gz', '.tar', '.gz', '.zip', '.doc', '.docx', '.xlsx', '.xls', '.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.tiff', '.pdf', '.txt', '.mp4', '.avi', '.mov', '.wmv', '.flv', '.mkv', '.m4v' ], // 新增允许接收的文件后缀
     // whitelist: [], // 覆盖允许接收的文件后缀
   };
   config.jwt = {

+ 1 - 1
service-gateway/ecosystem.config.js

@@ -1,6 +1,6 @@
 'use strict';
 
-const app = 'service-gateway';
+const app = 'skl-gateway';
 module.exports = {
   apps: [{
     name: app, // 应用名称

+ 7 - 6
service-log/config/config.default.js

@@ -36,13 +36,14 @@ module.exports = appInfo => {
   };
   // 数据库配置
   config.mongoose = {
-    url: 'mongodb://127.0.0.1/Microservices',
+    // url: 'mongodb://127.0.0.1:27018/Microservices',
+    url: 'mongodb://172.17.116.7:27018/Microservices',
     options: {
-      // user: 'root',
-      // pass: 'Ziyouyanfa#@!',
-      // authSource: 'admin',
-      // useNewUrlParser: true,
-      // useCreateIndex: true,
+      user: 'root',
+      pass: 'cms@cc-lotus',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
     },
   };
   config.logger = {

+ 1 - 1
service-log/ecosystem.config.js

@@ -1,6 +1,6 @@
 'use strict';
 
-const app = 'service-log';
+const app = 'skl-log';
 module.exports = {
   apps: [{
     name: app, // 应用名称

+ 8 - 6
service-login/config/config.default.js

@@ -36,15 +36,17 @@ module.exports = appInfo => {
   };
   // 数据库配置
   config.mongoose = {
-    url: 'mongodb://127.0.0.1/Microservices',
+    // url: 'mongodb://127.0.0.1:27018/Microservices',
+    url: 'mongodb://172.17.116.7:27018/Microservices',
     options: {
-      // user: 'root',
-      // pass: 'Ziyouyanfa#@!',
-      // authSource: 'admin',
-      // useNewUrlParser: true,
-      // useCreateIndex: true,
+      user: 'root',
+      pass: 'cms@cc-lotus',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
     },
   };
+
   config.redis = {
     client: {
       // port: 6389, // 部署

+ 1 - 1
service-login/ecosystem.config.js

@@ -1,6 +1,6 @@
 'use strict';
 
-const app = 'service-login';
+const app = 'skl-login';
 module.exports = {
   apps: [{
     name: app, // 应用名称

+ 7 - 6
service-naf/config/config.default.js

@@ -36,13 +36,14 @@ module.exports = appInfo => {
   };
   // 数据库配置
   config.mongoose = {
-    url: 'mongodb://127.0.0.1/Microservices',
+    // url: 'mongodb://127.0.0.1:27018/Microservices',
+    url: 'mongodb://172.17.116.7:27018/Microservices',
     options: {
-      // user: 'root',
-      // pass: 'Ziyouyanfa#@!',
-      // authSource: 'admin',
-      // useNewUrlParser: true,
-      // useCreateIndex: true,
+      user: 'root',
+      pass: 'cms@cc-lotus',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
     },
   };
   config.logger = {

+ 2 - 2
service-naf/ecosystem.config.js

@@ -1,6 +1,6 @@
-ng   'use strict';
+'use strict';
 
-const app = 'service-naf';
+const app = 'skl-naf';
 module.exports = {
   apps: [{
     name: app, // 应用名称