config.local.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { MidwayConfig } from '@midwayjs/core';
  2. /**数据库ip */
  3. const ip = '10.120.114.5';
  4. /**数据库名 */
  5. const dbName = 'cxyy';
  6. /**日志数据库名 */
  7. const logsDB = 'cxyy_logs';
  8. /**数据库用户名 */
  9. const dbUsername = 'system';
  10. /**数据库密码 */
  11. const dbPwd = '1234qwer!@#$';
  12. /**redis ip */
  13. const redisHost = '10.120.114.6';
  14. /**redis 密码 */
  15. const redisPwd = '1234qwer!@#$';
  16. /**redis 使用第几个数据库 */
  17. const redisDB = 0;
  18. /**redis 记录登录的key */
  19. const loginSign = 'cxyy';
  20. export default {
  21. // use for cookie sign key, should change to your own and keep security
  22. keys: '1697684406848_4978',
  23. loginSign,
  24. // 请求记录在redis留存时间,超过时间.数据变化将不会记录.以秒为单位--5分钟
  25. requestTimeLimit: 300,
  26. jwt: {
  27. secret: 'Ziyouyanfa!@#',
  28. expiresIn: 3600, // 3600
  29. },
  30. koa: {
  31. port: 9700,
  32. globalPrefix: '/cxyy/api',
  33. queryParseMode: 'extended',
  34. },
  35. swagger: {
  36. swaggerPath: '/doc/api',
  37. },
  38. elasticsearch: {
  39. node: 'http://192.168.1.197:9200',
  40. auth: {
  41. username: 'elastic',
  42. password: 'NAjqFz_7tS2DkdpU7p*x',
  43. },
  44. },
  45. typeorm: {
  46. dataSource: {
  47. default: {
  48. database: dbName,
  49. username: dbUsername,
  50. password: dbPwd,
  51. host: ip,
  52. port: 54321,
  53. entities: ['./entity'],
  54. type: 'postgres',
  55. synchronize: true, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
  56. logging: true,
  57. },
  58. logs: {
  59. database: logsDB,
  60. username: dbUsername,
  61. password: dbPwd,
  62. host: ip,
  63. port: 54321,
  64. entities: ['./entityLogs'],
  65. type: 'postgres',
  66. synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
  67. logging: true,
  68. },
  69. },
  70. },
  71. redis: {
  72. client: {
  73. port: 6379, // Redis port
  74. host: redisHost, // Redis host
  75. password: redisPwd,
  76. db: redisDB,
  77. },
  78. },
  79. upload: {
  80. whitelist: null,
  81. },
  82. } as MidwayConfig;