From 2fb0a73c16dd6139d908b810587bdf073410922f Mon Sep 17 00:00:00 2001 From: SelfRidicule Date: Fri, 17 May 2024 15:08:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=8F=E8=BF=B0:=20=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E5=A4=A7=E4=BA=8E1=E4=B8=AA=E9=A1=B5=E9=9D=A2=E5=B0=B1?= =?UTF-8?q?=E5=90=8E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/pages/login/login.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index d7d5f86..ef66755 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -78,8 +78,18 @@ Page({ wx.setStorageSync('token', token) wx.setStorageSync('parkId', user.parkId) wx.setStorageSync('parkName', user.parkName) - // 跳转首页 - wx.navigateBack() + + let currentPages = getCurrentPages(); + console.log('currentPages' , currentPages); + // 大于一个页面就后退,否则直接跳转首页 + if(currentPages.length > 1){ + wx.navigateBack() + }else{ + // 跳转首页 + wx.reLaunch({ + url: '/pages/index/index', + }) + } }, /**