Browse Source

feature: anous live

able99 4 years ago
parent
commit
5cfe69fbb0
1 changed files with 13 additions and 5 deletions
  1. 13 5
      pages/index/index.vue

+ 13 - 5
pages/index/index.vue

@@ -112,11 +112,19 @@
 					this.swiperHeight = res.windowWidth / 2
 				}
 			})
-			// if (!uni.getStorageSync('token')) {
-			// 	uni.reLaunch({
-			// 		url: '/pages/index/login'
-			// 	});
-			// }
+			if (!uni.getStorageSync('token')&&!uni.getStorageSync('userData')) {
+				// uni.reLaunch({
+				// 	url: '/pages/index/login'
+				// });
+				uni.setStorage({
+					key: 'userData',
+					data: {
+						headImage: '',
+						userName: '游客',
+						userId: String((new Date()).getTime() * Math.random()),
+					}
+				})
+			}
 		},
 		onShow() {
 			this.getBaseInfo()