<script>
	export default {
		globalData: {
			navbarHeight: 44,
		},
		onLaunch: async function() {
			console.log('App Launch')
			this.globalData.navbarHeight = uni.getSystemInfoSync().safeArea.top

			const token = this.vuex_token ? this.vuex_token : uni.getStorageSync('lifeData')?.vuex_token;
			if (token) {
				try {
					const {
						user
					} = await this.$u.api.getUserInfo()
					this.$u.vuex('vuex_user', user)
				} catch (err) {
					console.error(err)
				}
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";

	page {
		background-color: #f2f3f7;
	}
</style>