184 lines
4.3 KiB
JavaScript
184 lines
4.3 KiB
JavaScript
/*
|
||
* @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 + '_1745985142442_9900';
|
||
|
||
// add your middleware config here
|
||
config.middleware = [];
|
||
|
||
// add your user config here
|
||
const userConfig = {
|
||
// myAppName: 'egg',
|
||
};
|
||
config.redis = {
|
||
clients: {
|
||
cache: {
|
||
port: 6379,
|
||
host: '112.124.21.102',
|
||
password: 'qwe2019@',
|
||
db: 10,
|
||
},
|
||
printer: {
|
||
port: 6379,
|
||
host: '112.124.21.102',
|
||
password: 'qwe2019@',
|
||
db: 11,
|
||
}
|
||
},
|
||
};
|
||
config.security = {
|
||
csrf: {
|
||
enable: false,
|
||
},
|
||
};
|
||
config.qimen = {
|
||
appKey: 23535631,
|
||
security: 'd0cbd3935e3afa2b42b5dc600c08a795',
|
||
};
|
||
config.cos = {
|
||
appId: 1234567890,
|
||
secretId: 'AKIDeFhx1tQ5PYVYP9K8PXUFoazHRPBlpTXP',
|
||
secretKey: 'pcHtKbhcKqDNLqEQRIxRjpjRHxTnvGQT',
|
||
bucket: 'ye4s-1255377868',
|
||
region: 'ap-guangzhou',
|
||
uploadurl: 'https://ye4s-1255377868.cos.ap-guangzhou.myqcloud.com',
|
||
cdnurl: 'https://ye4s.file.gzxunren.com',
|
||
savekey: '/{warehouseId}/{dir}/{year}{mon}{day}/{filemd5}{.suffix}',
|
||
expire: 600,
|
||
maxsize: '100M',
|
||
mimetype: 'jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx,apk',
|
||
apiupload: 1,
|
||
dirs: {
|
||
image: '/images/',
|
||
document: '/documents/',
|
||
apk: '/apks/',
|
||
temp: '/temp/', // 临时文件目录
|
||
},
|
||
};
|
||
config.fileTypes = {
|
||
// 图片类型
|
||
image: 'image',
|
||
'image/jpeg': 'image',
|
||
'image/jpg': 'image',
|
||
'image/png': 'image',
|
||
'image/gif': 'image',
|
||
'image/bmp': 'image',
|
||
'image/webp': 'image',
|
||
'image/svg+xml': 'image',
|
||
|
||
// 文档类型
|
||
'application/pdf': 'document',
|
||
'application/msword': 'document',
|
||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'document',
|
||
'application/vnd.ms-excel': 'document',
|
||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'document',
|
||
'application/vnd.ms-powerpoint': 'document',
|
||
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'document',
|
||
'text/plain': 'document',
|
||
|
||
// 压缩文件
|
||
'application/zip': 'document',
|
||
'application/x-rar-compressed': 'document',
|
||
'application/x-7z-compressed': 'document',
|
||
|
||
// APK
|
||
'application/vnd.android.package-archive': 'apk',
|
||
|
||
// 视频
|
||
'video/mp4': 'video',
|
||
'video/mpeg': 'video',
|
||
'video/quicktime': 'video',
|
||
'video/x-msvideo': 'video',
|
||
|
||
// 音频
|
||
'audio/mpeg': 'audio',
|
||
'audio/wav': 'audio',
|
||
'audio/x-wav': 'audio',
|
||
'audio/x-m4a': 'audio',
|
||
};
|
||
config.cors = {
|
||
origin: '*', // 允许所有源,生产环境应指定具体域名
|
||
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
|
||
credentials: true, // 允许携带 cookie
|
||
};
|
||
|
||
config.mysql = {
|
||
clients: {
|
||
wms: {
|
||
host: '112.124.21.102',
|
||
port: '3306',
|
||
user: 'wms',
|
||
password: 'P6j3YTHTpirepYWz',
|
||
database: 'wms',
|
||
},
|
||
ye4s:{
|
||
host: '112.124.21.102',
|
||
port: '3306',
|
||
user: 'ye4s',
|
||
password: 'H@8h^QE4N$L.F_*',
|
||
database: 'ye4s',
|
||
}
|
||
},
|
||
app: true,
|
||
agent: false,
|
||
};
|
||
exports.sequelize = {
|
||
dialect: 'mysql',
|
||
host: '112.124.21.102',
|
||
port: 3306,
|
||
database: 'wms',
|
||
username: 'wms',
|
||
password: 'P6j3YTHTpirepYWz',
|
||
define: {
|
||
freezeTableName: true,
|
||
underscored: true,
|
||
timestamps: true,
|
||
paranoid: true, // 启用软删除
|
||
deletedAt: 'deleted_at', // 软删除字段名
|
||
},
|
||
pool: {
|
||
max: 5,
|
||
min: 1,
|
||
idle: 10000,
|
||
acquire: 30000,
|
||
},
|
||
};
|
||
|
||
config.jwt = {
|
||
expiresIn: 14400,
|
||
secret: 'E5#ex.g@,GfL_8?',
|
||
};
|
||
|
||
config.view = {
|
||
defaultViewEngine: 'ejs',
|
||
mapping: {
|
||
'.html': 'ejs',
|
||
},
|
||
};
|
||
config.cluster = {
|
||
listen: {
|
||
port: 6060, // 使用其他端口避免冲突
|
||
hostname: '0.0.0.0',
|
||
},
|
||
};
|
||
config.poloapi ={
|
||
|
||
}
|
||
config.debug = false; // 生成环境默认关闭 debug,开发环境通过 config.local.js 开启
|
||
config.printService = {
|
||
url: 'http://printer.wms.gztbyc.com',
|
||
};
|
||
return {
|
||
...config,
|
||
...userConfig,
|
||
};
|
||
};
|