/* 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 + '_1576744686394_2727'; // add your middleware config here config.middleware = []; // add your user config here const userConfig = { // myAppName: 'egg', }; config.proxy = true; config.hostHeaders = 'x-forwarded-host'; config.wxapi = { appid: 'wxa9997e40dea04213', // 微信公众号APPID appSecret: 'fef1a84c0c9a3ff56a7b2c7a23b7248f', baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址 mchid: '1505364491', // 商户ID mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key wxurl: 'http://broadcast.waityou24.cn/api/visit/wxpayback', payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder', }; // 服务器发布路径 config.baseUrl = 'http://broadcast.waityou24.cn'; // 认证回调地址 config.authUrl = '/api/visit/auth'; // 回调地址 config.redirect_uri = `${config.baseUrl}/weixin`; config.redirect_uri_doctor = `${config.baseUrl}/patient/manage`; config.redirect_uri_patient = `${config.baseUrl}/doctor/manage`; config.errorMongo = { details: true, }; config.errorHanler = { details: true, }; // add your config here config.cluster = { listen: { port: 8888, }, }; // base路径 config.sendDirMq = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid='; // appID config.appid = 'wxa9997e40dea04213'; config.REVIEW_TEMPLATE_ID = 'BI4h0AQpdctm74I7-7PyHAspSMX2oJOTJVQsgrppOag'; config.multipart = { fileSize: '50mb', // 文件大小 mode: 'file', // 文件模式 whitelist: [ '.xlsx' ], // 文件类型白名单 }; // 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: 'visit', password: 'visit', vhost: 'visit', }, app: true, agent: true, }; // mongoose config config.mongoose = { url: 'mongodb://127.0.0.1:27017/visit', options: { // user: 'admin', // pass: 'admin', // authSource: 'admin', // useNewUrlParser: true, // useCreateIndex: 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, }; };