123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /* eslint valid-jsdoc: "off" */
- 'use strict';
- const { sep } = require('path');
- const ErrorConfig = require('./config.error.js');
- /**
- * @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 + '_1577518454977_306';
- // add your middleware config here
- config.middleware = [];
- // add your user config here
- const userConfig = {
- // myAppName: 'egg',
- };
- config.cluster = {
- listen: {
- port: 8001,
- },
- };
- // 安全配置
- config.security = {
- csrf: {
- // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
- enable: false,
- },
- };
- config.cdn = {
- repos_root_path: `${appInfo.baseDir}${sep}upload`,
- repos_root_url: '',
- wxadio_path: `${appInfo.baseDir}${sep}upload${sep}wxadio${sep}`,
- };
- config.wx = {
- wxdown: 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/media/get?appid=wxdf3ed83c095be97a&media_id=',
- appid: 'wxdf3ed83c095be97a',
- };
- config.onerror = ErrorConfig;
- // 文件上传配置
- config.multipart = {
- whitelist: [
- '.jpg', '.jpeg', // image/jpeg
- '.png',
- '.zip', '.rar', // 压缩文件
- '.txt',
- '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx',
- '.dbf',
- '.pdf',
- '.mp4',
- '.MP4',
- '.avi',
- '.AVI',
- '.rmvb',
- ],
- fileSize: '200mb',
- };
- return {
- ...config,
- ...userConfig,
- };
- };
|