处理无响应请求
This commit is contained in:
parent
a3c4e78c22
commit
d27fa31ac7
@ -85,8 +85,26 @@ Page({
|
||||
|
||||
},
|
||||
fail: function (e) {
|
||||
alertError("打开失败")
|
||||
console.log('打开失败错误为', e)
|
||||
// alertError("打开失败")
|
||||
// console.log('打开失败错误为', e)
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '打开失败,请复制链接后通过浏览器打开',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
wx.setClipboardData({
|
||||
data: data,
|
||||
success: () => {
|
||||
alertSuccess("复制成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -80,7 +80,11 @@ const request = async function (options, config = {}) {
|
||||
const parseResponse = function (response, url) {
|
||||
console.log('response', response)
|
||||
if (!response) {
|
||||
alertError("服务无响应")
|
||||
wx.redirectTo({
|
||||
url: '/pages/login/index',
|
||||
})
|
||||
wx.clearStorageSync()
|
||||
alertError("无响应,请重试")
|
||||
return
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user