|
|
@@ -149,21 +149,24 @@ class HTTP {
|
|
|
header: header,
|
|
|
timeout: 60000,
|
|
|
success: res => resolve(res.data),
|
|
|
- fial: err => reject(err),
|
|
|
+ fail: err => reject(err),
|
|
|
complete: (res) => {
|
|
|
// if (loading) wx.hideLoading()
|
|
|
- if (res.data.code != 1) {
|
|
|
- console.error("错误的请求", {
|
|
|
- request: data,
|
|
|
- result: res.data
|
|
|
- })
|
|
|
- }
|
|
|
if (res.errMsg != 'request:ok') {
|
|
|
+ console.error("请求失败", { request: data, result: res })
|
|
|
wx.showToast({
|
|
|
title: getApp().globalData.Language.getMapText('网络异常,请重新进入'),
|
|
|
icon: "none"
|
|
|
})
|
|
|
- } else if (res.data.msg == '登陆状态已过期,请重新登陆!' || res.data.msg == getApp().globalData.Language.getMapText('登陆状态已过期,请重新登陆!')) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data && res.data.code != 1) {
|
|
|
+ console.error("错误的请求", {
|
|
|
+ request: data,
|
|
|
+ result: res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (res.data && (res.data.msg == '登陆状态已过期,请重新登陆!' || res.data.msg == getApp().globalData.Language.getMapText('登陆状态已过期,请重新登陆!'))) {
|
|
|
wx.showToast({
|
|
|
title: getApp().globalData.Language.getMapText(res.data.msg),
|
|
|
icon: "none",
|