caojunjie 4 vuotta sitten
vanhempi
commit
348730fe6f
1 muutettua tiedostoa jossa 24 lisäystä ja 24 poistoa
  1. 24 24
      App.vue

+ 24 - 24
App.vue

@@ -4,12 +4,12 @@
 		mapMutations
 	} from 'vuex'
 	export default {
-		// data() {
-		// 	return {
-		// 		show: false,
-		// 		// content: '东临碣石,以观沧海'
-		// 	}
-		// },
+		data() {
+			return {
+				show: false,
+				content: '东临碣石,以观沧海'
+			}
+		},
 		// 此处globalData为了演示其作用,不是uView框架的一部分
 		computed: {
 			...mapState(['hasLogin'])
@@ -21,24 +21,24 @@
 			...mapMutations(['login'])
 		},
 		created() {
-			// const storeInfo = uni.getStorageSync("storeInfo") || "";
-			// if (storeInfo) {
-			// 	uni.getStorage({
-			// 		key: "storeInfo",
-			// 		success: (res) => {
-			// 			this.login(res.data)
-			// 			this.$u.route({
-			// 				url: 'pages/home/index',
-			// 				type: 'switchTab',
-			// 			})
-			// 		},
-			// 	})
-			// } else {
-			// 	this.$u.route({
-			// 		url: "pages/login/index",
-			// 		type: "redirect"
-			// 	})
-			// }
+			const storeInfo = uni.getStorageSync("storeInfo") || "";
+			if (storeInfo) {
+				uni.getStorage({
+					key: "storeInfo",
+					success: (res) => {
+						this.login(res.data)
+						this.$u.route({
+							url: 'pages/home/index',
+							type: 'switchTab',
+						})
+					},
+				})
+			} else {
+				this.$u.route({
+					url: "pages/login/index",
+					type: "redirect"
+				})
+			}
 		},
 		// onLaunch() {
 		// 	this.$u.route({