2017-11-29 10:13:35 -05:00
|
|
|
import weiboUpload from './weiboUpload'
|
|
|
|
import qiniuUpload from './qiniuUpload'
|
2017-12-20 22:18:54 -05:00
|
|
|
import tcYunUpload from './tcYunUpload'
|
2017-11-29 10:13:35 -05:00
|
|
|
import db from '../../datastore/index'
|
|
|
|
const uploader = (img, type, webContents) => {
|
|
|
|
const uploadType = db.read().get('picBed.current').value()
|
|
|
|
switch (uploadType) {
|
|
|
|
case 'weibo':
|
|
|
|
return weiboUpload(img, type, webContents)
|
|
|
|
case 'qiniu':
|
|
|
|
return qiniuUpload(img, type, webContents)
|
2017-12-20 22:18:54 -05:00
|
|
|
case 'tcyun':
|
|
|
|
return tcYunUpload(img, type, webContents)
|
2017-11-29 10:13:35 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default uploader
|