From f756d7bf64052535f62c4c81f016593af17968bd Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 28 May 2021 10:28:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=89=AB=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 30 ++++++++++++++++++------------ app.json | 2 +- pages/bind/binduser.js | 15 +++++++-------- pages/main/main.js | 5 +++-- project.config.json | 9 +++++---- 5 files changed, 34 insertions(+), 27 deletions(-) diff --git a/app.js b/app.js index 07c1025..01b05f9 100644 --- a/app.js +++ b/app.js @@ -53,18 +53,24 @@ App({ } }); wx.hideLoading() - // var pages = getCurrentPages() - // var currentPage = pages[pages.length-1] //获取当前页面的对象 - // var url = currentPage.route - if(that.globalData.hopeUrl){ - wx.reLaunch({ - url: that.globalData.hopeUrl, - }) - }else{ - wx.reLaunch({ - url: '/pages/main/main', - }) - } + var pages = getCurrentPages() + var currentPage = pages[pages.length-1] //获取当前页面的对象 + var url = currentPage.route + if(that.globalData.hopeUrl){ + wx.redirectTo({ + url: that.globalData.hopeUrl, + }) + }else{ + wx.redirectTo({ + url:'/'+url, + fail: function(){ + wx.reLaunch({ + url:'/'+url + }) + } + }) + } + } else { wx.hideLoading() diff --git a/app.json b/app.json index b73b90a..3b1c6da 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "pages": [ - "pages/bind/binduser", "pages/main/main", + "pages/bind/binduser", "pages/index/index", "pages/logs/logs", "pages/trouble/trouble", diff --git a/pages/bind/binduser.js b/pages/bind/binduser.js index 7ab59b1..548e73a 100644 --- a/pages/bind/binduser.js +++ b/pages/bind/binduser.js @@ -178,21 +178,20 @@ Page({ } } } - if(getApp().globalData.sessionId){ - if(url){ - wx.reLaunch({ - url: url, + if(getApp().globalData.hopeUrl){ + wx.redirectTo({ + url: getApp().globalData.hopeUrl, }) - }else{ - wx.reLaunch({ + getApp().globalData.hopeUrl = null + } + else{ + wx.switchTab({ url: '/pages/main/main', }) } - return } - }, /** diff --git a/pages/main/main.js b/pages/main/main.js index c6421d7..592458d 100644 --- a/pages/main/main.js +++ b/pages/main/main.js @@ -96,8 +96,9 @@ Page({ */ onShow: function () { var that = this - that.getNew() - + if(getApp().globalData.sessionId){ + that.getNew() + } if (getApp().globalData.userInfo.companyid == 2681) { this.setData({ isGjjt: true, diff --git a/project.config.json b/project.config.json index 9f566ca..9bef95c 100644 --- a/project.config.json +++ b/project.config.json @@ -3,7 +3,7 @@ "setting": { "urlCheck": false, "es6": true, - "enhance": true, + "enhance": false, "postcss": true, "preloadBackgroundData": false, "minified": true, @@ -19,14 +19,15 @@ "uploadWithSourceMap": true, "compileHotReLoad": false, "useMultiFrameRuntime": false, - "useApiHook": true, + "useApiHook": false, + "useApiHostProcess": false, "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" }, - "bundle": false, - "useIsolateContext": true, + "enableEngineNative": false, + "useIsolateContext": false, "useCompilerModule": false, "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false,