config.default.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const { jwt } = require('./config.secret');
  4. const ip = '120.48.146.1';
  5. /**
  6. * @param {Egg.EggAppInfo} appInfo app info
  7. */
  8. module.exports = appInfo => {
  9. /**
  10. * built-in config
  11. * @type {Egg.EggAppConfig}
  12. **/
  13. const config = (exports = {});
  14. // use for cookie sign key, should change to your own and keep security
  15. config.keys = appInfo.name + '_1578642242928_5726';
  16. // add your middleware config here
  17. config.middleware = [ 'checkIsLogin', 'logs' ];
  18. // add your user config here
  19. const userConfig = {
  20. // myAppName: 'egg',
  21. };
  22. config.errorMongo = {
  23. details: true,
  24. };
  25. config.errorHanler = {
  26. details: true,
  27. };
  28. // add your config here
  29. config.cluster = {
  30. listen: {
  31. port: 7001,
  32. },
  33. };
  34. config.wxapi = {
  35. appid: 'wxdf3ed83c095be97a', // 微信公众号APPID
  36. appSecret: '748df7c2a75077a79ae0c971b1638244',
  37. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  38. mchid: '1505364491', // 商户ID
  39. mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key
  40. wxurl: 'http://free.liaoningdoupo.com/api/wxpayback',
  41. payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
  42. sendDirMq: 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=',
  43. };
  44. // 签到小程序
  45. config.wxapp = {
  46. appid: 'wx3b5ac763ada73e0e',
  47. secret: '0f30fcbb9ad45697800611ad4af585bb',
  48. grant_type: 'authorization_code',
  49. };
  50. config.proxy = true;
  51. config.hostHeaders = 'x-forwarded-host';
  52. // 服务器发布路径
  53. config.baseUrl = 'http://jytz.jilinjobs.cn';
  54. // 认证回调地址
  55. config.authUrl = '/api/train/auth';
  56. // 回调地址
  57. config.redirect_uri = `${config.baseUrl}/weixin`;
  58. config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`;
  59. config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`;
  60. // base路径
  61. // appID
  62. config.appid = 'wxdf3ed83c095be97a';
  63. config.REVIEW_TEMPLATE_ID = '16F_xIWRXcjefFgBw85uL1JtKYpKOy8tpO1ncG0PO3c';
  64. // 邮箱配置
  65. config.user_email = 'system@jilinjobs.cn';
  66. config.auth_code = 'vgWtywkwMJpN8QDL';
  67. // 导出配置
  68. config.cdn = {
  69. repos_root_path: '/usr/local/workspace/service-file/upload',
  70. repos_root_url_excel: '/excel/',
  71. repos_root_url_experience: '/experience/',
  72. repos_root_url_zip: '/zip/',
  73. };
  74. // mq配置
  75. config.amqp = {
  76. client: {
  77. hostname: ip,
  78. username: 'visit',
  79. password: 'visit',
  80. vhost: 'train',
  81. },
  82. app: true,
  83. agent: true,
  84. };
  85. // redis config
  86. config.redis = {
  87. client: {
  88. port: 6379, // Redis port
  89. host: ip, // Redis host
  90. password: '123456',
  91. db: 0,
  92. },
  93. };
  94. // mongoose config
  95. config.mongoose = {
  96. url: 'mongodb://127.0.0.1:27017/train',
  97. options: {
  98. user: 'root',
  99. pass: 'root',
  100. authSource: 'admin',
  101. useNewUrlParser: true,
  102. useCreateIndex: true,
  103. },
  104. };
  105. // config.mongoose = {
  106. // url: 'mongodb://192.168.1.20:27017/train',
  107. // options: {
  108. // user: 'admin',
  109. // pass: 'admin',
  110. // authSource: 'admin',
  111. // useUnifiedTopology: true,
  112. // useNewUrlParser: true,
  113. // useCreateIndex: true,
  114. // },
  115. // };
  116. config.mission = {
  117. baseUrl: 'http://127.0.0.1:7003',
  118. };
  119. config.auth = {
  120. baseUrl: 'http://127.0.0.1:7002',
  121. };
  122. // 安全配置
  123. config.security = {
  124. csrf: {
  125. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  126. enable: false,
  127. },
  128. };
  129. // // JWT config
  130. config.jwt = {
  131. ...jwt,
  132. expiresIn: '1d',
  133. issuer: 'train',
  134. };
  135. config.yunjiuye = {
  136. toBindPage: 'https://jytz.jilinjobs.cn/y/', // 云就业绑定页面
  137. toDealTokenPage: 'https://jytz.jilinjobs.cn/y/deal', // 云就业免登录处理token路由
  138. };
  139. config.httpclient = {
  140. request: {
  141. // 默认 request 超时时间
  142. timeout: 3000,
  143. },
  144. };
  145. config.yjyLoginKey = 'yjyLoginKey:';
  146. return {
  147. ...config,
  148. ...userConfig,
  149. };
  150. };