Ver Fonte

修改登录情况下什么时候跳首页

李万涛 há 2 anos atrás
pai
commit
66820dc3ec
2 ficheiros alterados com 7 adições e 5 exclusões
  1. 1 5
      App.vue
  2. 6 0
      pages/user/signin.vue

+ 1 - 5
App.vue

xqd
@@ -4,11 +4,7 @@
 	} from "@/common";
 	export default {
 		onLaunch(options) {
-			if (uni.getStorageSync('token')) {
-				uni.redirectTo({
-					url: '/pages/index/index'
-				})
-			}
+
 
 			// init(options);
 			// // #ifndef MP-TOUTIAO

+ 6 - 0
pages/user/signin.vue

xqd
@@ -220,6 +220,12 @@
 			}
 		},
 		async onLoad(option) {
+			if (uni.getStorageSync('token')) {
+				uni.redirectTo({
+					url: '/pages/index/index'
+				})
+			}
+
 			if (navigator.userAgent.indexOf('Mobile') > -1) {
 				// alert('移动端')
 				this.isPc = false