From b77e8e776af4d81e748e9e21d51b64a11085a195 Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期四, 19 十二月 2024 10:49:11 +0800
Subject: [PATCH] 未提交退出提示

---
 pages/bindInfo/index.js |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/pages/bindInfo/index.js b/pages/bindInfo/index.js
index 897d56c..1fcccf6 100644
--- a/pages/bindInfo/index.js
+++ b/pages/bindInfo/index.js
@@ -1,5 +1,7 @@
 // pages/index/bindInfo/index.js
-import { setSessionGuid } from "../../assets/js/userAction"
+import {
+  setSessionGuid
+} from "../../assets/js/userAction"
 const app = getApp();
 Page({
 
@@ -56,10 +58,10 @@
               if (res && res.status == "Ok") {
                 // 鍌ㄥ瓨token
                 wx.setStorageSync(app.config.tokenKey, res.token);
-                // 璁板綍鐧诲綍缁熻
-                setSessionGuid()
                 // 鑾峰彇鐢ㄦ埛淇℃伅
                 this.getUserInfo()
+                // 璁板綍鐧诲綍缁熻
+                setSessionGuid()
               } else {
                 wx.showToast({
                   icon: "error",
@@ -74,6 +76,7 @@
   },
   // 鑾峰彇鐧诲綍鐢ㄦ埛韬唤
   getUserInfo() {
+    let that = this;
     app.MG.identity.getCurrentAppUser().then(res => {
       // 鐢ㄦ埛淇℃伅浼樺厛绾э細鏁欏笀璁よ瘉 > 寰俊 > 瀛︾敓锛堟敞鍐屾椂榛樿锛�
       if (res) {
@@ -93,9 +96,15 @@
         }
         wx.setStorageSync(app.config.userInfoKey, JSON.stringify(defaultUser));
       }
-      wx.switchTab({
-        url: this.data.redirectPage ? this.data.redirectPage : '/pages/home/home'
-      })
+      if (that.data.redirectPage == "" || that.data.redirectPage == "/pages/home/home" || that.data.redirectPage == "/pages/bookServices/assort/index" || that.data.redirectPage == "/pages/study/index" || that.data.redirectPage == "/pages/cart/index" || that.data.redirectPage == "/pages/personalCenter/index") {
+        wx.switchTab({
+          url: that.data.redirectPage != "" ? that.data.redirectPage : '/pages/home/home'
+        })
+      } else {
+        wx.navigateTo({
+          url: that.data.redirectPage
+        })
+      }
     });
   },
 

--
Gitblit v1.9.1