From 0e05f43f7f285c6a9d4390fb5e9435edd22e9928 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Tue, 19 Oct 2021 17:29:42 +0800 Subject: [PATCH] u --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 31846fa..7cfae14 100644 --- a/index.js +++ b/index.js @@ -220,7 +220,9 @@ module.exports = { uni.hideLoading() try{ // 不知为何,uni.uploadFile返回的 data 是字符串而不是对象 - data = JSON.parse(data) + if (typeof(data)==='string') { + data = JSON.parse(data) + } }catch(exp){ return { _state: 'CLIENT_FAIL_RESPONSE_JSON_MALFORMED'} } @@ -304,11 +306,9 @@ module.exports = { }) { if (backend==='UNICLOUD'){ const resultCloud = await this.pickupFile2Cloud({mediaType, count, sizeType, sourceType, maxDuration }) - this.colog(resultCloud) return resultCloud - }else if (backend==='SERVER' && url){ + }else // if (backend==='SERVER'){ const resultServer = await this.pickupFile2Server({mediaType, count, sizeType, sourceType, maxDuration, url, header, formData, name}) - this.colog(resultServer) return resultServer } },