config.default.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. module.exports = appInfo => {
  7. const config = exports = {};
  8. config.keys= 'siGeZuiShuAi';
  9. // post form请求 关闭csrf安全插件
  10. config.security = {
  11. csrf: {
  12. enable: false,
  13. ignoreJSON: true,
  14. },
  15. // domainWhiteList: [ 'http://www.baidu.com' ], // 配置白名单
  16. };
  17. config.mongoose = {
  18. // url: 'mongodb://172.17.0.1/info_admin', // 华为云 需连VPN
  19. url: 'mongodb://127.0.0.1/info_admin', // 本地
  20. // url: 'mongodb://172.17.222.95:27017/info_admin', // 正式-info_admin表用户
  21. options: {
  22. useUnifiedTopology: true,
  23. },
  24. };
  25. // 指定启动端口为7002
  26. config.cluster = {
  27. listen: {
  28. path: '',
  29. port: 7002,
  30. },
  31. };
  32. const userConfig = {
  33. // 跨域配置
  34. cors: {
  35. origin: '*', // 注释掉就是上面的white生效
  36. allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
  37. },
  38. sessionTimeOut: 86400, // 24H
  39. dept1ObjectId: '5d4289205ffc6694f7e42082',
  40. defaultAdminRoleId: '5d030a91ebd90c299489c121',
  41. };
  42. return {
  43. ...config,
  44. ...userConfig,
  45. };
  46. };