Fixed: cookie error

This commit is contained in:
Molunerfinn 2018-01-18 09:31:15 +08:00
parent 7364ea6ddf
commit e5d5bad115

View File

@ -59,9 +59,18 @@ const weiboUpload = async function (img, type, webContents) {
result = result.replace(/<.*?\/>/, '').replace(/<(\w+).*?>.*?<\/\1>/, '')
delete imgList[i].base64Image
const resTextJson = JSON.parse(result)
if (resTextJson.data.pics.pic_1.pid === undefined) {
webContents.send('uploadProgress', -1)
const notification = new Notification({
title: '上传失败!',
body: '微博Cookie失效请在网页版重新登录一遍'
})
notification.show()
} else {
imgList[i]['imgUrl'] = `https://ws1.sinaimg.cn/${quality}/${resTextJson.data.pics.pic_1.pid}`
imgList[i]['type'] = 'weibo'
}
}
webContents.send('uploadProgress', 100)
return imgList
} else {