config.default.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const code = require('./code');
  4. const files = require('./files');
  5. const cms = require('./cms');
  6. const log = require('./log');
  7. const login = require('./login');
  8. // const wx = require('./wx');
  9. const naf = require('./naf');
  10. // const journal = require('./journal');
  11. /**
  12. * @param {Egg.EggAppInfo} appInfo app info
  13. */
  14. module.exports = appInfo => {
  15. /**
  16. * built-in configlo
  17. * @type {Egg.EggAppConfig}
  18. **/
  19. const config = exports = {};
  20. // use for cookie sign key, should change to your own and keep security
  21. config.keys = appInfo.name + '_1637282221255_6501';
  22. // add your middleware config here
  23. config.middleware = [];
  24. // add your user config here
  25. const userConfig = {
  26. // myAppName: 'egg',
  27. };
  28. // 安全配置
  29. config.security = {
  30. csrf: {
  31. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  32. enable: false,
  33. },
  34. };
  35. config.cluster = {
  36. listen: {
  37. port: 18090,
  38. },
  39. };
  40. config.modules = {
  41. login: 'http://127.0.0.1:18095',
  42. code: 'http://127.0.0.1:18091',
  43. files: 'http://127.0.0.1:18093',
  44. naf: 'http://127.0.0.1:18096',
  45. cms: 'http://127.0.0.1:18092',
  46. log: 'http://127.0.0.1:18094',
  47. };
  48. // 限制文件大小
  49. config.multipart = {
  50. mode: 'stream',
  51. fileSize: '5mb',
  52. 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' ], // 新增允许接收的文件后缀
  53. // whitelist: [], // 覆盖允许接收的文件后缀
  54. };
  55. config.jwt = {
  56. secret: '123456',
  57. };
  58. config.apipath = { code, files, naf, cms, login, log };
  59. return {
  60. ...config,
  61. ...userConfig,
  62. };
  63. };