Browse Source

token过期弹出

zhaoxiaohai 2 years ago
parent
commit
84c04456e9
1 changed files with 9 additions and 1 deletions
  1. 9 1
      utils/Http.js

+ 9 - 1
utils/Http.js

@@ -26,7 +26,7 @@ class HTTP {
             timeout: 60000,
             success: (res) => {
                 resolve(res.data);
-                if (loading) wx.hideLoading()
+                if (loading) wx.hideLoading();
             },
             fial: (err) => {
                 reject(err);
@@ -39,6 +39,14 @@ class HTTP {
                         title: '网络异常,请重新进入',
                         icon: "none"
                     })
+                } else if (res.data.msg == '登陆状态已过期,请重新登陆!') {
+                    wx.redirectTo({
+                        url: '/pages/login/phone',
+                    });
+                    wx.showToast({
+                        title: '登陆状态已过期,请重新登陆!',
+                        icon: "none"
+                    })
                 }
             }
         })