-
Notifications
You must be signed in to change notification settings - Fork 285
/
Copy pathapp-upload.js
34 lines (32 loc) · 1.22 KB
/
app-upload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const weiBo = require('./picture/wei-bo');
const DataStore = require('./app-store');
const dataStore = new DataStore();
const picgo = require('./picture/picgo/picgo');
exports.uploadPicture = async function (fullpath) {
const Bed = dataStore.getFigureBedSwitch();
switch (Bed) {
case dataStore.PIC_WEIBO:
return await weiBo.uploadPictureToWeiBo(fullpath);
case dataStore.PIC_SMMS:
return await picgo.uploadPicture(fullpath, Bed);
case dataStore.PIC_GITHUB:
return await picgo.uploadPicture(fullpath, Bed);
case dataStore.PIC_ALIYUN:
return await picgo.uploadPicture(fullpath, Bed);
case dataStore.PIC_QINIU:
return await picgo.uploadPicture(fullpath, Bed);
case dataStore.PIC_UPYUN:
return await picgo.uploadPicture(fullpath, Bed);
case dataStore.PIC_TCYUN:
return await picgo.uploadPicture(fullpath, Bed);
case dataStore.PIC_IMGUR:
return await picgo.uploadPicture(fullpath, Bed);
default:
return await uploadPicture();
}
};
function uploadPicture() {
return new Promise((resolve, reject) => {
reject("未启用任何图床!")
})
}