提交 d4412042 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 2979bea1
......@@ -82,7 +82,7 @@ httpRequest.defaults.fail = (res, config) => {
wx.showToast({ title: '接口请求失败,请检查网络设置', icon: 'none' })
return res
}
if (res.data.status === 403 || res.data.status === 401) {
if (res.data.status === 403) {
// 未登录
wx.redirectTo({ url: '/pages/login/index' })
return
......
......@@ -43,11 +43,21 @@ const requestApi = obj => {
// wx.showToast({ title: JSON.stringify(res.data), icon: 'none' }) // 自己后台封装返回
// }
obj.callback(res)
} else if (res.statusCode === 403 || res.statusCode === 401) {
} else if (res.statusCode === 403) {
/* 未授权登录,跳转首页 */
wx.reLaunch({
url: '/pages/login/index'
})
} else if (res.statusCode === 401) {
wx.showModal({ title: '未授权', content: '是否要成为学员', showCancel: true }).then(res => {
res.confirm &&
wx.redirectTo({
url: `/pages/web/index?url=${encodeURIComponent(
'https://webapp-pub.ezijing.com/pages/ciis/ciis.html?channel_num=96091'
)}`
})
res.cancel && wx.reLaunch({ url: '/pages/login/index' })
})
} else {
wx.showToast({ title: res.errMsg, icon: 'none' }) // 微信封装返回
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论