You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
738 B
30 lines
738 B
/**
|
|
* Created by PengLing on 2017/12/26.
|
|
*/
|
|
'use strict';
|
|
|
|
function createConfig(opts = {}) {
|
|
let config = {
|
|
uploadPath: opts.uploadPath || 'other', // 'other' equivalent to '/other'
|
|
maxSize: 10485760 // 10M
|
|
};
|
|
|
|
if (opts.qiniu) {
|
|
config.qiniu = {
|
|
accessKey: 'YwL-KPPPrPFqm5VfCDLSSePi6pa0c0rxbTDGVUSQ',
|
|
secretKey: 'dFHk_EfTk6ufIaG56h4gzcL3IrAtwl2RkJcl8XuO',
|
|
bucket: 'savoir-test',
|
|
domain: 'http://p1wqkojj4.bkt.clouddn.com'
|
|
};
|
|
} else {
|
|
config.local = {
|
|
origin: opts.origin,
|
|
rootPath: opts.rootPath,
|
|
childPath: opts.childPath
|
|
};
|
|
}
|
|
|
|
return config;
|
|
}
|
|
|
|
module.exports = createConfig;
|
|
|