From 4bc1c36faeec2f90e5acfa836732e49fe0b245e9 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期五, 12 四月 2024 20:47:03 +0800 Subject: [PATCH] 云学习11 --- pages/bindInfo/index.js | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pages/bindInfo/index.js b/pages/bindInfo/index.js index 0386d5d..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({ @@ -59,7 +61,7 @@ // 鑾峰彇鐢ㄦ埛淇℃伅 this.getUserInfo() // 璁板綍鐧诲綍缁熻 - // setSessionGuid() + 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.navigateTo({ - 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