wx.upload()回调方法返回数据格式问题

小程序 文章 2020-08-19 15:41 666 0 全屏看文

AI助手支持GPT4.0

wx.upload()回调方法返回数据格式问题Wx.upload() callback method returns data format problem

wx.upload()回调方法返回数据格式问题
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.upload() 微信iOS客户端 7.0.15 2.12.1

wx.upload()回调方法返回数据格式是string,而不是json串

Framework type problem type API / component name terminal type wechat version basic library version applet bug wx.upload () wechat IOS client 7.0.15 2.12.1 wx.upload () the returned data format of callback method is string, not JSON string

回答:

子不语:

wx.upload() 这个api哪来的?为什么我没查到相关文档?

请学会如何「提问」(👈戳我)【个体工商户】微信认证问题(👈戳我)

幸运人:api->网络->上传
子不语:那不是uploadFile么?那个数据格式是string类型的,你自行JSON.parse 一下

请学会如何「提问」(👈戳我)【个体工商户】微信认证问题(👈戳我)

stop eating:文档上有说明,返回string
幸运人:那为什么不支持Object类型,第一次用的话容易出错
微喵网络:

对,需要json的话,自己使用JSON.parse


-EOF-

AI助手支持GPT4.0