问题已解决:在我的代码里,我做了一个判断,上传后响应码200,才处理图片获取,不知道小程序为什么把响应码改成204了???
导致我获取图片的那段代码不执行,wtf?!!!
<感谢以下几位大佬的关注和回答:《None absolute _天马行空_ 搞文艺的猿》 (排名不分先后)>
做了一个小程序,已经上线运行,之前一直都挺正常的,最近突然图片上传不能回调成功了,代码都没动过,为啥呢??
我用工具在电脑上也能正常上传,日志输出也正常,但是在手机上使用就不能正常上传图片,导致功能无法使用。。。。
调用的微信自带的上传方法,求大神指导~谢谢
/**
* 上传文件
*/
function uploadFile(cloudPath, filePath) {
return wx.cloud.uploadFile({
cloudPath: cloudPath,
filePath: filePath, // 文件路径
})
}
小程序后台开发》开发设置》服务器域名
返回的error信息是什么?
刚刚真机调试打印错误了,之前一直没有。。。 errMsg: "cloud.callFunction:fail polling exceed max timeout retry (callId: 1591927356814-0.6794197597446838) (trace: 10:2:36 start->10:2:36 app show->10:2:52 timeout, retry->10:3:7 timeout, retry->10:3:23 timeout, abort); at cloud.callFunction api; " stack: "Error: errCode: -404012 polling exceed max timeout retry | errMsg: cloud.callFunction:fail polling exceed max timeout retry (callId: 1591927356814-0.6794197597446838) (trace: 10:2:36 start->10:2:36 app show->10:2:52 timeout, retry->10:3:7 timeout, retry->10:3:23 timeout, abort); at cloud.callFunction api; ↵ at new u (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:258831)↵ at d (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:259338)↵ at f (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:259433)↵ at eval (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:426528)↵ at eval (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:255256)↵ at Object.eval [as next] (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:255361)↵ at r (eval at n.call.document (http://127.0.0.1:26814/remote-debug/runtime.js?devtools_ignore=true:1:8794), <anonymous>:2:254107)"
https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#networkTimeout
报什么错???,你这什么也看不出来啊