config.default.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. const goods = require('./goods');
  12. /**
  13. * @param {Egg.EggAppInfo} appInfo app info
  14. */
  15. module.exports = appInfo => {
  16. /**
  17. * built-in config
  18. * @type {Egg.EggAppConfig}
  19. **/
  20. const config = exports = {};
  21. // use for cookie sign key, should change to your own and keep security
  22. config.keys = appInfo.name + '_1637282221255_6501';
  23. // add your middleware config here
  24. config.middleware = [];
  25. // add your user config here
  26. const userConfig = {
  27. // myAppName: 'egg',
  28. };
  29. // 安全配置
  30. config.security = {
  31. csrf: {
  32. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  33. enable: false,
  34. },
  35. };
  36. config.cluster = {
  37. listen: {
  38. port: 18090,
  39. },
  40. };
  41. config.modules = {
  42. login: 'http://127.0.0.1:9000',
  43. code: 'http://127.0.0.1:9001',
  44. files: 'http://127.0.0.1:9002',
  45. naf: 'http://127.0.0.1:9003',
  46. cms: 'http://127.0.0.1:9004',
  47. wx: 'http://127.0.0.1:9005',
  48. log: 'http://127.0.0.1:9006',
  49. market: 'http://127.0.0.1:9007',
  50. goods: 'http://127.0.0.1:9008',
  51. journal: 'http://127.0.0.1:9009',
  52. contribution: 'http://127.0.0.1:9010',
  53. org: 'http://127.0.0.1:9011',
  54. media: 'http://127.0.0.1:9012',
  55. clientUser: 'http://127.0.0.1:9013',
  56. clientvip: 'http://127.0.0.1:9014',
  57. activity: 'http://127.0.0.1:9015',
  58. importExport: 'http://127.0.0.1:9016',
  59. reader: 'http://127.0.0.1:9017',
  60. };
  61. // 限制文件大小
  62. config.multipart = {
  63. mode: 'stream',
  64. fileSize: '5mb',
  65. fileExtensions: [ '.zip' ], // 新增允许接收的文件后缀
  66. // whitelist: [], // 覆盖允许接收的文件后缀
  67. };
  68. config.jwt = {
  69. secret: '123456',
  70. };
  71. config.apipath = { code, files, naf, cms, login, wx, log, journal, goods };
  72. return {
  73. ...config,
  74. ...userConfig,
  75. };
  76. };