config.default.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 + '_1594203525504_9703';
  14. // add your middleware config here
  15. config.middleware = ["errorHandler", "loginAdmin", "loginUser"];
  16. config.loginAdmin = {
  17. secret:'train server',
  18. match:["/admin/user/list", "/admin/user/recordList"],
  19. expiresIn:24*60*60
  20. // ignore:["/user/**"]
  21. };
  22. config.loginUser = {
  23. secret:"train app",
  24. expiresIn:15*24*60*60,
  25. match:["/app/user", "/app/insurant","/app/social"],
  26. };
  27. config.server = {
  28. host:"http://192.168.1.10:7102",
  29. publicHost:"http://192.168.1.10:7102/public/"
  30. };
  31. config.security = {
  32. csrf: {
  33. enable: false,
  34. ignoreJSON: true
  35. },
  36. domainWhiteList: ['http://www.infish.cn']
  37. }
  38. config.cors = {
  39. origin:'*',
  40. allowMethods:"POST,GET,PUT,DELETE",
  41. // credentials:true
  42. };
  43. config.devUsers = {
  44. users:["root"],
  45. pwds:["9573e6e8c1594f3ce274cede0486de23"]
  46. }
  47. // config.mysql = {
  48. // // 单数据库信息配置
  49. // client: {
  50. // // host
  51. // host: 'qpp-db.c0enopwe9gcd.rds.cn-north-1.amazonaws.com.cn',
  52. // // 端口号
  53. // port: '3306',
  54. // // 用户名
  55. // user: 'admin',
  56. // // 密码
  57. // password: 'zJdu6sQTogCzDPLip',
  58. // // 数据库名
  59. // database: 'qpp_db',
  60. // },
  61. // // 是否加载到 app 上,默认开启
  62. // app: true,
  63. // // 是否加载到 agent 上,默认关闭
  64. // agent: false,
  65. // };
  66. config.multipart = {
  67. // enable: true,
  68. fileSize: '5mb',
  69. mode:"stream",
  70. fileExtensions:[".png",".jpg",".jpeg"]
  71. };
  72. // add your user config here
  73. const userConfig = {
  74. // myAppName: 'egg',
  75. };
  76. return {
  77. ...config,
  78. ...userConfig,
  79. };
  80. };