123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- /* eslint valid-jsdoc: "off" */
- 'use strict';
- const code = require('./code');
- const files = require('./files');
- const cms = require('./cms');
- const log = require('./log');
- const login = require('./login');
- const wx = require('./wx');
- const naf = require('./naf');
- const journal = require('./journal');
- const goods = require('./goods');
- /**
- * @param {Egg.EggAppInfo} appInfo app info
- */
- module.exports = appInfo => {
- /**
- * built-in config
- * @type {Egg.EggAppConfig}
- **/
- const config = exports = {};
- // use for cookie sign key, should change to your own and keep security
- config.keys = appInfo.name + '_1637282221255_6501';
- // add your middleware config here
- config.middleware = [];
- // add your user config here
- const userConfig = {
- // myAppName: 'egg',
- };
- // 安全配置
- config.security = {
- csrf: {
- // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
- enable: false,
- },
- };
- config.cluster = {
- listen: {
- port: 18090,
- },
- };
- config.modules = {
- login: 'http://127.0.0.1:9000',
- code: 'http://127.0.0.1:9001',
- files: 'http://127.0.0.1:9002',
- naf: 'http://127.0.0.1:9003',
- cms: 'http://127.0.0.1:9004',
- wx: 'http://127.0.0.1:9005',
- log: 'http://127.0.0.1:9006',
- market: 'http://127.0.0.1:9007',
- goods: 'http://127.0.0.1:9008',
- journal: 'http://127.0.0.1:9009',
- contribution: 'http://127.0.0.1:9010',
- org: 'http://127.0.0.1:9011',
- media: 'http://127.0.0.1:9012',
- clientUser: 'http://127.0.0.1:9013',
- clientVip: 'http://127.0.0.1:9014',
- activity: 'http://127.0.0.1:9015',
- importExport: 'http://127.0.0.1:9016',
- reader: 'http://127.0.0.1:9017',
- question: 'http://127.0.0.1:9018',
- };
- // 限制文件大小
- config.multipart = {
- mode: 'stream',
- fileSize: '5mb',
- fileExtensions: [ '.zip' ], // 新增允许接收的文件后缀
- // whitelist: [], // 覆盖允许接收的文件后缀
- };
- config.jwt = {
- secret: '123456',
- };
- config.apipath = { code, files, naf, cms, login, wx, log, journal, goods };
- return {
- ...config,
- ...userConfig,
- };
- };
|