webview动态url出现加载失败?
发布于 7 年前 作者 leimin 9675 次浏览 来自 官方Issues

wxml代码:<web-view src="{{url}}#wechat_redirect" bindload=“webLoadSuccess” binderror=“webLoadFail”></web-view>

js代码:

onshow:中使用动态url,直接给url加了随机数参数,如:

this.setData({

        url: decodeURIComponent(`${url}?random=${(new Date().getTime())}`)

})

在webview binderror中上报了日志,从云函数数据库中发现超多错误日志(错误频率很高)

2 回复

decodeURIComponent(`${url}?random=${(new Date().getTime())}`)

这个有值吗

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部