wx.downloadFile真机调试不报错 正式环境报错?

小程序 文章 2021-03-12 18:01 574 0 全屏看文

AI助手支持GPT4.0

wx.downloadFile真机调试不报错 正式环境报错?wx.downloadFile does not report an error when debugging on real machine. Does the official environment report an error?

wx.downloadFile真机调试不报错 正式环境报错?

downloadFile合法域名已设置

在真机调试和预览开启调试下不报错 正式环境和预览关闭会报错"图片保存失败222"

代码如下:

The legal domain name of downloadfile has been set. No error will be reported when the real machine is debugged and the preview is turned on. An error will be reported when the official environment and the preview are turned off. The code of "picture saving failed 222" is as follows:

回答:

默垂眸:

把所有回调参数补上

然后开发版打开调试 进入正式版 看下调试打印的啥问题

W@w:

会不会下载文件的安全域名没有配置,去看看配置,或者在开发工具里面关掉不校验业务域名,就可以看到是不是因为没有配置域名导致的

Brother斌🎈:

这种时候应该直接输出res,不然都不知道wx.downloadFile报啥错


-EOF-

AI助手支持GPT4.0