Ver código fonte

add to local

stanley-king 4 anos atrás
pai
commit
b8c35f2c0c
2 arquivos alterados com 9 adições e 2 exclusões
  1. 8 0
      app.js
  2. 1 2
      pages/auth/auth.js

+ 8 - 0
app.js

@@ -121,6 +121,14 @@ App({
     clearRecord() {
         this.globalData.record = null
     },
+    navigateback() {
+        if (getCurrentPages().length <= 1) {
+            wx.reLaunch({ url: "/pages/home/home" })
+        }
+        else {
+            wx.navigateBack()
+        }
+    },
     navigateto(page) {
         if (!this.globalData.userInfo) {
             this.globalData.authPages.forEach(prefix => {

+ 1 - 2
pages/auth/auth.js

@@ -32,8 +32,7 @@ Page({
 
   getAuth(e) {
     let { userInfo,phoneInfo} = e.detail 
-    switchtab   
-    wx.navigateBack()
+    app.navigateback();
   },
 
   /**