htc 2 days ago
parent
commit
81c30d5d64
2 changed files with 16 additions and 9 deletions
  1. 9 9
      App.vue
  2. 7 0
      pages/login.vue

+ 9 - 9
App.vue

@@ -11,15 +11,15 @@
 		onLaunch: function() {
 		onLaunch: function() {
 		},
 		},
 		onShow: function() {
 		onShow: function() {
-			if(uni.getStorageSync('userInfo')){
-				uni.reLaunch({
-					url:'/pages/home'
-				})
-			}else{
-				uni.reLaunch({
-					url:'/pages/login'
-				})
-			}
+			// if(uni.getStorageSync('userInfo')){
+			// 	uni.reLaunch({
+			// 		url:'/pages/home'
+			// 	})
+			// }else{
+			// 	uni.reLaunch({
+			// 		url:'/pages/login'
+			// 	})
+			// }
 		},
 		},
 		onHide: function() {
 		onHide: function() {
 		}
 		}

+ 7 - 0
pages/login.vue

@@ -19,6 +19,13 @@
 				agree:false
 				agree:false
 			}
 			}
 		},
 		},
+		onReady() {
+			if(uni.getStorageSync('userInfo')){
+				uni.reLaunch({
+					url:'/pages/home'
+				})
+			}
+		},
 		methods:{
 		methods:{
 			changeAgree(){
 			changeAgree(){
 				this.agree = !this.agree;
 				this.agree = !this.agree;