/* eslint valid-jsdoc: "off" */ 'use strict'; /** * @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 + '_1594203525504_9703'; // add your middleware config here config.middleware = ["errorHandler", "loginAdmin", "loginUser"]; config.loginAdmin = { secret:'train server', match:["/admin/user/list", "/admin/user/recordList"], expiresIn:24*60*60 // ignore:["/user/**"] }; config.loginUser = { secret:"train app", expiresIn:15*24*60*60, match:["/app/user", "/app/insurant","/app/social"], }; config.server = { host:"http://192.168.1.10:7102", publicHost:"http://192.168.1.10:7102/public/" }; config.security = { csrf: { enable: false, ignoreJSON: true }, domainWhiteList: ['http://www.infish.cn'] } config.cors = { origin:'*', allowMethods:"POST,GET,PUT,DELETE", // credentials:true }; config.devUsers = { users:["root"], pwds:["9573e6e8c1594f3ce274cede0486de23"] } // config.mysql = { // // 单数据库信息配置 // client: { // // host // host: 'qpp-db.c0enopwe9gcd.rds.cn-north-1.amazonaws.com.cn', // // 端口号 // port: '3306', // // 用户名 // user: 'admin', // // 密码 // password: 'zJdu6sQTogCzDPLip', // // 数据库名 // database: 'qpp_db', // }, // // 是否加载到 app 上,默认开启 // app: true, // // 是否加载到 agent 上,默认关闭 // agent: false, // }; config.multipart = { // enable: true, fileSize: '5mb', mode:"stream", fileExtensions:[".png",".jpg",".jpeg"] }; // add your user config here const userConfig = { // myAppName: 'egg', }; return { ...config, ...userConfig, }; };