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 } },