From 7364ea6ddf52d482811f74c25804eca131100a65 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Tue, 16 Jan 2018 17:05:33 +0800 Subject: [PATCH] Fixed: imgList error --- src/main/utils/weiboUpload.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/utils/weiboUpload.js b/src/main/utils/weiboUpload.js index 3f5abad..832c101 100644 --- a/src/main/utils/weiboUpload.js +++ b/src/main/utils/weiboUpload.js @@ -44,17 +44,17 @@ const weiboUpload = async function (img, type, webContents) { } webContents.send('uploadProgress', 60) const imgList = await img2Base64[type](img) - let opt = { - formData: { - b64_data: imgList[i].base64Image - } - } - if (chooseCookie) { - opt.headers = { - Cookie: cookie - } - } for (let i in imgList) { + let opt = { + formData: { + b64_data: imgList[i].base64Image + } + } + if (chooseCookie) { + opt.headers = { + Cookie: cookie + } + } let result = await rp.post(UPLOAD_URL, opt) result = result.replace(/<.*?\/>/, '').replace(/<(\w+).*?>.*?<\/\1>/, '') delete imgList[i].base64Image