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. modulesConfig: {
  39. es: `http://${redisHost}/cxyy/es`,
  40. mq: `http://${redisHost}/cxyy/mq`,
  41. },
  42. typeorm: {
  43. dataSource: {
  44. default: {
  45. database: dbName,
  46. username: dbUsername,
  47. password: dbPwd,
  48. host: ip,
  49. port: 54321,
  50. entities: ['./entity'],
  51. type: 'postgres',
  52. synchronize: true, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
  53. logging: true,
  54. },
  55. logs: {
  56. database: logsDB,
  57. username: dbUsername,
  58. password: dbPwd,
  59. host: ip,
  60. port: 54321,
  61. entities: ['./entityLogs'],
  62. type: 'postgres',
  63. synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
  64. logging: false,
  65. },
  66. },
  67. },
  68. redis: {
  69. client: {
  70. port: 6379, // Redis port
  71. host: redisHost, // Redis host
  72. password: redisPwd,
  73. db: redisDB,
  74. },
  75. },
  76. upload: {
  77. whitelist: null,
  78. },
  79. PathConfig: {
  80. path: 'C:\\temp\\cxyy\\',
  81. },
  82. } as MidwayConfig;