
"networkTimeout": {
"request": 10000
}
设置超时时间,单位毫秒
2、请求
wx.request时超时会进入 fail方法
fail: function () {
wx.hideLoading()
wx.showModal({
title: '提示',
showCancel: false,
content: '请求超时,请退出重新扫码!',
success: function () {
wx.redirectTo({
url: '../scan/scan'
})
}
})
}
小程序最新更新timeout 请求超时的语法,只需要在app,json中配置一下就可以了。https://developers.weixin.qq.com/miniprogram/dev/framework/config.html#%E5%85%A8%E5%B1%80%E9%85%8D%E7%BD%AE
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)