/* 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: 9999, }, }; config.wxapi = { appid: 'wx6db5d25b3e7cfc14', // 微信公众号APPID baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址 mchid: '1505364491', // 商户ID mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key wxurl: 'http://free.liaoningdoupo.com/api/wxpayback', payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder', }; config.proxy = true; config.hostHeaders = 'x-forwarded-host'; // 服务器发布路径 config.baseUrl = 'http://free.liaoningdoupo.com'; // 认证回调地址 config.authUrl = '/api/auth/wxchat'; // 项目之间的变量 config.project = { market: 'http://localhost:9004/api/market', }; config.mongoose = { url: 'mongodb://localhost:27017/platform', 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.security = { csrf: { // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求 enable: false, }, }; // // JWT config config.jwt = { ...jwt, expiresIn: '1d', issuer: 'jobs', }; return { ...config, ...userConfig, }; };