config.default.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. module.exports = appInfo => {
  7. /**
  8. * built-in config
  9. * @type {Egg.EggAppConfig}
  10. **/
  11. const config = exports = {};
  12. // use for cookie sign key, should change to your own and keep security
  13. config.keys = appInfo.name + '_1637194502813_3847';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. // 安全配置
  21. config.security = {
  22. csrf: {
  23. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  24. enable: false,
  25. },
  26. };
  27. config.cluster = {
  28. listen: {
  29. port: 18095,
  30. },
  31. };
  32. // 数据库配置
  33. config.mongoose = {
  34. // url: 'mongodb://127.0.0.1:27018/Microservices',
  35. url: 'mongodb://172.17.116.7:27018/Microservices',
  36. options: {
  37. user: 'root',
  38. pass: 'cms@cc-lotus',
  39. authSource: 'admin',
  40. useNewUrlParser: true,
  41. useCreateIndex: true,
  42. },
  43. };
  44. config.redis = {
  45. client: {
  46. // port: 6389, // 部署
  47. port: 6379,
  48. host: '127.0.0.1',
  49. // password: 'Ziyouyanfa#@!',
  50. password: null,
  51. db: 0,
  52. },
  53. };
  54. config.jwt = {
  55. issuer: 'naf',
  56. expiresIn: '12h',
  57. secret: '123456',
  58. };
  59. config.wxconfig = {
  60. appid: 'wx545cae03cce08392',
  61. appsecret: '5b90761f94b1b26b5119298f661765ba',
  62. };
  63. config.view = {
  64. defaultViewEngine: 'nunjucks',
  65. mapping: {
  66. '.njk': 'nunjucks',
  67. },
  68. };
  69. // 禁止登录次数
  70. config.ban = 3;
  71. // 禁止登录时间
  72. config.bantime = 60 * 5;
  73. config.logger = {
  74. level: 'DEBUG',
  75. };
  76. return {
  77. ...config,
  78. ...userConfig,
  79. };
  80. };