Skip to content

Commit f246b8d

Browse files
abnerleeMolunerfinn
authored andcommitted
🐛 Fix: image_repeated error from smms (#28)
silent and get real image url from image_repeated error from sm.ms
1 parent ed2250a commit f246b8d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/plugins/uploader/smms.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const handle = async (ctx: PicGo): Promise<PicGo> => {
3434
delete imgList[i].base64Image
3535
delete imgList[i].buffer
3636
imgList[i]['imgUrl'] = body.data.url
37+
} else if (body.code === 'image_repeated' && typeof body.images === 'string') { // do extra check since this error return is not documented at https://doc.sm.ms/#api-Image-Upload
38+
delete imgList[i].base64Image
39+
delete imgList[i].buffer
40+
imgList[i]['imgUrl'] = body.images
3741
} else {
3842
ctx.emit('notification', {
3943
title: '上传失败',

0 commit comments

Comments
 (0)