12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /* 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');
- /**
- * @param {Egg.EggAppInfo} appInfo app info
- */
- module.exports = appInfo => {
- /**
- * built-in configlo
- * @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:18095',
- code: 'http://127.0.0.1:18091',
- files: 'http://127.0.0.1:18093',
- naf: 'http://127.0.0.1:18096',
- cms: 'http://127.0.0.1:18092',
- log: 'http://127.0.0.1:18094',
- };
- // 限制文件大小
- config.multipart = {
- mode: 'stream',
- fileSize: '5mb',
- 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 = {
- secret: '123456',
- };
- config.apipath = { code, files, naf, cms, login, log };
- return {
- ...config,
- ...userConfig,
- };
- };
|