From e3a8d46ed7f215a7ad1d61d7e6d3a853e3922361 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 30 七月 2024 19:13:47 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_jiaxuan/utils/request.js |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/wechat_jiaxuan/utils/request.js b/wechat_jiaxuan/utils/request.js
index 7d34329..d111b6c 100644
--- a/wechat_jiaxuan/utils/request.js
+++ b/wechat_jiaxuan/utils/request.js
@@ -1,9 +1,10 @@
 import { baseUrl } from "./config"
-
+let number = 0
 export function request(options){
   let loading = options.loading || '1' // 榛樿鍊�1鏄剧ず锛屽惁鍒欎笉鏄剧ず
   if(loading == '1'){
     wx.showLoading()
+    number ++ 
   }
   return new Promise(resolve => {
     wx.request({
@@ -19,9 +20,9 @@
         if (res.data.code === 200) {
           resolve(res.data || true)
         } else {
-          if(res.data.code && res.data.code == 5112){
-            wx.navigateTo({
-              url: '/pages/auth/auth',
+          if(res.data.code == 5111 || res.data.code == 5112){
+            wx.switchTab({
+              url: '/pages/index/index',
             })
           }
           res.data.message && wx.showToast({
@@ -39,7 +40,10 @@
       },
       complete() {
         if(loading == '1'){
-          wx.hideLoading()
+          number --
+          if(number == 0){
+            wx.hideLoading()
+          }
         }
       }
     })

--
Gitblit v1.9.3