config.default.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const { jwt } = require('./config.secret');
  4. /**
  5. * @param {Egg.EggAppInfo} appInfo app info
  6. */
  7. module.exports = appInfo => {
  8. /**
  9. * built-in config
  10. * @type {Egg.EggAppConfig}
  11. **/
  12. const config = exports = {};
  13. // use for cookie sign key, should change to your own and keep security
  14. config.keys = appInfo.name + '_1571378739964_3623';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.errorMongo = {
  22. details: true,
  23. };
  24. config.errorHanler = {
  25. details: true,
  26. };
  27. // add your config here
  28. config.cluster = {
  29. listen: {
  30. port: 8107,
  31. },
  32. };
  33. config.multipart = {
  34. fileSize: '50mb', // 文件大小
  35. mode: 'file', // 文件模式
  36. whitelist: [ '.xlsx' ], // 文件类型白名单
  37. };
  38. // mongoose config
  39. // config.mongoose = {
  40. // url: 'mongodb://127.0.0.1:27017/smart',
  41. // options: {
  42. // user: 'root',
  43. // pass: 'Ziyouyanfa#@!',
  44. // authSource: 'admin',
  45. // useNewUrlParser: true,
  46. // useCreateIndex: true,
  47. // },
  48. // };
  49. // base路径
  50. config.fileDirImp = 'D:\\tmp\\';
  51. // base路径
  52. config.baseDirImp = 'http://smart.cc-lotus.info';
  53. // 学生信息url
  54. config.stusDirImp = '/stud/enrollments';
  55. // axios service config
  56. config.axios = {
  57. stud: { // 学生服务
  58. baseUrl: 'http://localhost:8101/api',
  59. },
  60. };
  61. config.amqp = {
  62. client: {
  63. hostname: '127.0.0.1',
  64. username: 'smart',
  65. password: 'smart123',
  66. vhost: 'smart',
  67. },
  68. app: true,
  69. agent: true,
  70. };
  71. // mongoose config
  72. config.mongoose = {
  73. url: 'mongodb://127.0.0.1:27017/smart',
  74. options: {
  75. user: 'root',
  76. pass: 'Ziyouyanfa#@!',
  77. authSource: 'admin',
  78. useNewUrlParser: true,
  79. useCreateIndex: true,
  80. },
  81. };
  82. // JWT config
  83. config.jwt = {
  84. ...jwt,
  85. expiresIn: '1d',
  86. issuer: 'jobs',
  87. };
  88. return {
  89. ...config,
  90. ...userConfig,
  91. };
  92. };