123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /* eslint valid-jsdoc: "off" */
- 'use strict';
- /**
- * @param {Egg.EggAppInfo} appInfo app info
- */
- const { jwt } = require('./config.secret');
- 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 + '_1666686710616_3993';
- config.appName = '天恩活泉商城-服务';
- // add your middleware config here
- config.middleware = [ 'setUserFromToken' ];
- config.checkToken = {
- enable: false,
- };
- // 进程设置
- config.cluster = {
- listen: {
- port: 12112,
- },
- };
- // 数据库设置
- config.dbName = 'point_shopping';
- config.mongoose = {
- url: `mongodb://120.48.146.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
- options: {
- user: 'admin',
- pass: 'admin',
- authSource: 'admin',
- useNewUrlParser: true,
- useCreateIndex: true,
- useFindAndModify: true,
- allowDiskUse: true,
- },
- };
- // jwt设置
- config.jwt = {
- ...jwt,
- expiresIn: '1d',
- issuer: 'shopping',
- };
- // 路由设置
- config.routePrefix = '/point/zr/v1/api';
- config.emailConfig = {
- config: 'free',
- };
- config.smsConfig = {
- config: 'free',
- };
- // 中间件
- config.requestLog = {
- toMongoDB: true,
- };
- config.redisKey = {
- orderKeyPrefix: 'zrOrderKey:',
- };
- config.redisTimeout = 3600;
- config.wxPayConfig = 'pointApp';
- // add your user config here
- const userConfig = {
- // myAppName: 'egg',
- };
- return {
- ...config,
- ...userConfig,
- };
- };
|