Commit 5c6a05a1 authored by HAYWAEL's avatar HAYWAEL

fix

parent 7bce5521
Pipeline #27910 canceled with stage
in 1 minute 0 seconds
export interface ConfigDefaultState {
multipart?: { fileExtensions: string[]; fileSize: string; };
projectRootPath?: string;
keys?: string;
middleware?: any;
jwtMiddle?: { exclude: string[]; };
export interface ConfigLocalState {
debug?: boolean;
sessionExpireIn?: number;
jwt?: any;
security?: any;
cors?: any;
DD_CONFIG?: any;
oss?: any;
onerror?: any;
mailer?: any;
sequelize?: any;
redis?: any;
SERVICE_HOST?: string;
runEnv?: string;
proxy?: any;
}
export default (appInfo: { name: string; }) => {
const config: ConfigDefaultState = {};
export default () => {
const config: ConfigLocalState = {};
config.multipart = {
fileExtensions: [
'.xlsx',
'.xls',
],
fileSize: '100mb',
};
config.projectRootPath = '/api';
// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_1537508791174_5973';
config.debug = true;
// add your config here
config.middleware = [
'errorHandler',
'pagination',
'jwtMiddle',
];
config.jwtMiddle = {
exclude: [
'/api/login',
],
};
config.sessionExpireIn = 60 * 60 * 24 * 7 * 10000;
config.jwt = {
secret: '123456',
};
// 是否启用csrf安全
config.security = {
csrf: {
enable: false,
},
domainWhiteList: [],
};
config.cors = {
origin: '*',
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
credentials: true,
};
config.DD_CONFIG = {
corpId: 'dingbd41a9a5fb105629', // 公司唯一标识
secret: '5gz8ZKXwNWqiIjUeemVI1Zxnw7s6PJx6KJLOpabexuZhCSYREloULpNMUlWGJEQm', // 认证密钥,非常重要,妥善保管,具有极高权限
token: 'dsrtiw', // 加解密时有用到
aesKey: '1234567890123456789012345678901234567890123', // 加解密时有用到
agentId: {
// 微应用的ID
default: '116146340',
},
nonceStr: 'gjjj51', // aes加解密及签名时用到, len=6
sso: {
appId: 'dingoameqb6kx8gwcg50wi', // 钉钉扫码登陆的 appId
appSecret: 'aCep7Y_Tr5x6ISr-UTML88pBN5KBqzhxSJ9FwA-emTq_GJaWZCRA-P1thcd2K-0E', // 钉钉扫码登陆的 appSecret
},
};
config.oss = {
clients: {
default: {
accessKeyId: 'LTAIRRW7SbrqKUIJ',
accessKeySecret: 'AC15o0PrchUiK1xlZx7DhF5Bmumt7K',
bucket: 'nodeadmin',
endpoint: 'oss-cn-hangzhou.aliyuncs.com',
timeout: '60s',
},
media: {
accessKeyId: 'LTAIA1esjBRaabT9',
accessKeySecret: '2Bf7tp5Dkr657ZzUv1bfwbEgl1zQT4',
bucket: '51shequ',
endpoint: 'oss-cn-hangzhou.aliyuncs.com',
timeout: '60s',
},
},
};
config.onerror = {
appErrorFilter: err => {
if (err.status && Math.floor(err.status / 100) === 4) {
return false;
}
return true;
},
};
config.mailer = {
client: {
host: 'smtp.exmail.qq.com',
port: 465,
user: 'report@jianbing.com', // generated ethereal user
pass: 'AAbb1234', // generated ethereal password
sender: '煎饼网络数据中心--测试',
},
secret: '51e69bd6-7fdb-4a76-ac83-0d32b6f09723',
exp: Math.floor(Date.now() / 1000) + config.sessionExpireIn, // 一周
enable: true, // default is false
credentialsRequired: false,
match: '*', // optional
};
config.sequelize = {
datasources: [{
// 东八时区
timezone: '+08:00',
delegate: 'wafangModel',
baseDir: 'model/wafang',
dialect: 'mysql',
host: 'rm-wafang-rds-pubilc.mysql.rds.aliyuncs.com',
database: 'wafang_dev',
username: 'wafang_test',
password: 'ztQ4Y8piePY3521gx74Ii',
port: 3306,
}],
};
config.SERVICE_HOST = 'https://dev-nginx.jianbing.com';
config.runEnv = 'uat';
config.proxy = {
match: /(\/api\/yizhi\/)/, // path pattern.
proxyList: [{
match: /(\/api\/yizhi\/)/,
host: config.SERVICE_HOST, // target host that matched path will be proxy to
map(path) { return path.replace(/(\/api\/yizhi)/, '/yizhi_server/api'); }, // 预处理路径
suppressRequestHeaders: [], // 不需要转发的请求头
}],
};
return config;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment