Преглед изворни кода

更改登录成功不跳转

chenrui пре 4 година
родитељ
комит
e5c89f7a3b
1 измењених фајлова са 6 додато и 5 уклоњено
  1. 6 5
      src/pages/login/index.vue

+ 6 - 5
src/pages/login/index.vue

@@ -68,11 +68,12 @@ export default {
             wx.setStorageSync('phone', res.data.phone);
             wx.setStorageSync('userId', res.data.userId);
             wx.removeStorageSync('openid');
-            if (this.path === '/pages/index/main' || this.lanuch) {
-              wx.reLaunch({ url: this.path });
-            } else {
-              wx.redirectTo({ url: this.path });
-            }
+            // if (this.path === '/pages/index/main' || this.lanuch) {
+            //   wx.reLaunch({ url: this.path });  //  关闭所有页面,打开到应用内的某个页面
+            // } else {
+            //   wx.redirectTo({ url: this.path });  //  关闭当前页面,跳转到应用内的某个页面
+            // }
+            wx.reLaunch({ url: '/pages/index/main' })  //  关闭所有页面,打开到应用内的某个页面
           } else {
             wx.showToast({
               title: res.message,