PicList/src/main/utils/uploader.js

15 lines
416 B
JavaScript
Raw Normal View History

2017-11-29 10:13:35 -05:00
import weiboUpload from './weiboUpload'
import qiniuUpload from './qiniuUpload'
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)
}
}
export default uploader