收藏
回答

wx.request({})? success data 提示是非法json格式字符串

api:

wx.request

问题:

请求一个get接口,

success 响应结果显示是非法json字符串,无法解析为对象,

同样的请求Chrome浏览器可以把响应结果解析为对象。

微信开发者工具实际响应结果

{"code":0,"msg":"操作成功","data":{"total":4,"rows":[{"source":3,"userId":null,"createTime":"2024-06-21 14:01:37","companyName":null,"mobileno":"19999999999","cntrType":null,"email":null,"fromPort":null,"toPort":null,"sailingDate":null,"remark":"你们联系我吧,手机"},{"source":1,"userId":null,"createTime":"2024-06-11 15:31:52","companyName":"测试3","mobileno":"16666666666","cntrType":"整车","email":null,"fromPort":"土耳其","toPort":"大连","sailingDate":"2024-06-11","remark":"这是秘密"},{"source":2,"userId":null,"createTime":"2024-06-11 15:31:41","companyName":"测试2","mobileno":"17777777777","cntrType":"一般化工品","email":null,"fromPort":"深圳","toPort":"马来西亚","sailingDate":"2024-06-28","remark":"普货"},{"source":1,"userId":1,"createTime":"2024-06-11 15:17:12","companyName":"测试公司","mobileno":"18888888888","cntrType":"普货","email":null,"fromPort":"青岛","toPort":"土耳其","sailingDate":"2024-07-01","remark":"这是一个备注"}]}}{"code":0,"msg":"操作成功","data":{"total":4,"rows":[{"source":3,"userId":null,"createTime":"2024-06-21 14:01:37","companyName":null,"mobileno":"19999999999","cntrType":null,"email":null,"fromPort":null,"toPort":null,"sailingDate":null,"remark":"你们联系我吧,手机"},{"source":1,"userId":null,"createTime":"2024-06-11 15:31:52","companyName":"测试3","mobileno":"16666666666","cntrType":"整车","email":null,"fromPort":"土耳其","toPort":"大连","sailingDate":"2024-06-11","remark":"这是秘密"},{"source":2,"userId":null,"createTime":"2024-06-11 15:31:41","companyName":"测试2","mobileno":"17777777777","cntrType":"一般化工品","email":null,"fromPort":"深圳","toPort":"马来西亚","sailingDate":"2024-06-28","remark":"普货"},{"source":1,"userId":1,"createTime":"2024-06-11 15:17:12","companyName":"测试公司","mobileno":"18888888888","cntrType":"普货","email":null,"fromPort":"青岛","toPort":"土耳其","sailingDate":"2024-07-01","remark":"这是一个备注"}]}}


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容