Skip to content

Commit 00b3f66

Browse files
committed
🐛 Fix: s.ee compatibility issues
1 parent 352a885 commit 00b3f66

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/plugins/uploader/smms.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,10 @@ const handle = async (ctx: IPicGo): Promise<IPicGo> => {
4040
try {
4141
const res: string = await ctx.request(postConfig)
4242
const body = JSON.parse(res)
43-
if (body.code === 'success') {
43+
if (body.code === 200 || body.message === 'success') {
4444
delete img.base64Image
4545
delete img.buffer
4646
img.imgUrl = body.data.url
47-
} 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
48-
delete img.base64Image
49-
delete img.buffer
50-
img.imgUrl = body.images
5147
} else {
5248
ctx.emit(IBuildInEvent.NOTIFICATION, {
5349
title: ctx.i18n.translate<ILocalesKey>('UPLOAD_FAILED'),

0 commit comments

Comments
 (0)