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', + }) + } }, /**