/* eslint valid-jsdoc: "off" */ 'use strict'; const { jwt } = require('./config.secret'); /** * @param {Egg.EggAppInfo} appInfo app info */ module.exports = appInfo => { /** * built-in config * @type {Egg.EggAppConfig} **/ const config = exports = {}; // use for cookie sign key, should change to your own and keep security config.keys = appInfo.name + '_1587024572540_7742'; // add your middleware config here config.middleware = []; // add your user config here const userConfig = { // myAppName: 'egg', }; // add your config here config.cluster = { listen: { port: 5555, }, }; config.wxapi = { appid: 'wxdf3ed83c095be97a', // 微信公众号APPID appSecret: '748df7c2a75077a79ae0c971b1638244', baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址 mchid: '1505364491', // 商户ID mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key wxurl: 'https://free.liaoningdoupo.com/api/onlive/wxpayback', payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder', }; config.proxy = true; config.hostHeaders = 'x-forwarded-host'; // 服务器发布路径 config.baseUrl = 'https://free.liaoningdoupo.com'; // 认证回调地址 config.authUrl = '/api/onlive/auth'; // 直播appid与key config.sdkappid = 1400414461; config.secretkey = '9726ce6e54b766c88903218c189dbcd11e7030613c076ff21bc0cc56c8072f24'; config.mongoose = { url: 'mongodb://localhost:27017/liveplatform', options: { user: 'admin', pass: 'admin', authSource: 'admin', useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true, }, }; // redis config config.redis = { client: { port: 6379, // Redis port host: '127.0.0.1', // Redis host password: 123456, db: 0, }, }; config.amqp = { client: { hostname: '127.0.0.1', username: 'live', password: 'live', vhost: 'live', }, app: true, agent: true, }; // 安全配置 config.security = { csrf: { // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求 enable: false, }, }; // // JWT config config.jwt = { ...jwt, expiresIn: '1d', issuer: 'jobs', }; config.view = { defaultViewEngine: 'nunjucks', mapping: { '.njk': 'nunjucks', }, }; return { ...config, ...userConfig, }; };