12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import { MidwayConfig } from '@midwayjs/core';
- /**数据库ip */
- const ip = '10.120.114.5';
- /**数据库名 */
- const dbName = 'cxyy';
- /**日志数据库名 */
- const logsDB = 'cxyy_logs';
- /**数据库用户名 */
- const dbUsername = 'system';
- /**数据库密码 */
- const dbPwd = '1234qwer!@#$';
- /**redis ip */
- const redisHost = '10.120.114.6';
- /**redis 密码 */
- const redisPwd = '1234qwer!@#$';
- /**redis 使用第几个数据库 */
- const redisDB = 0;
- /**redis 记录登录的key */
- const loginSign = 'cxyy';
- export default {
- // use for cookie sign key, should change to your own and keep security
- keys: '1697684406848_4978',
- loginSign,
- // 请求记录在redis留存时间,超过时间.数据变化将不会记录.以秒为单位--5分钟
- requestTimeLimit: 300,
- jwt: {
- secret: 'Ziyouyanfa!@#',
- expiresIn: 3600, // 3600
- },
- koa: {
- port: 9700,
- globalPrefix: '/cxyy/api',
- queryParseMode: 'extended',
- },
- swagger: {
- swaggerPath: '/doc/api',
- },
- elasticsearch: {
- node: 'http://192.168.1.197:9200',
- auth: {
- username: 'elastic',
- password: 'NAjqFz_7tS2DkdpU7p*x',
- },
- },
- typeorm: {
- dataSource: {
- default: {
- database: dbName,
- username: dbUsername,
- password: dbPwd,
- host: ip,
- port: 54321,
- entities: ['./entity'],
- type: 'postgres',
- synchronize: true, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
- logging: true,
- },
- logs: {
- database: logsDB,
- username: dbUsername,
- password: dbPwd,
- host: ip,
- port: 54321,
- entities: ['./entityLogs'],
- type: 'postgres',
- synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
- logging: true,
- },
- },
- },
- redis: {
- client: {
- port: 6379, // Redis port
- host: redisHost, // Redis host
- password: redisPwd,
- db: redisDB,
- },
- },
- upload: {
- whitelist: null,
- },
- } as MidwayConfig;
|