yancoding / yancoding.github.io

github page
0 stars 0 forks source link

小程序ios环境下finally报错 | yan blog #15

Open yancoding opened 2 years ago

yancoding commented 2 years ago

https://yancoding.github.io/posts/48ca7288cd2a/

解决办法判断是否存在finally方法,不存在则在Promise原型上添加finally方法 // 兼容ios真机环境下Promise对象不存在finally方法if (!Promise.prototype.finally) { Promise.prototype.finally = function(callback) { this.then(res => &#