<script>
	import { userInfo } from './api/user'
	export default {
		onLaunch: function() {
			console.log('App Launch')
			this.refreshUserInfo()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			/**
			 * 使用当前token刷新用户信息并更新状态管理
			 */
			refreshUserInfo(){
				userInfo().then(res=>{
					this.$store.commit('setUserInfo',res)
				})
			}
		}
	}
</script>

<style>
	@import "@/static/fonts/iconfont.css";
	.body {
		.state-bar{
			height: var(--status-bar-height);
		}
		.head{
			padding: 24rpx;
			display: grid;
			grid-template-columns: 1fr 2fr 1fr;
			.title{
				text-align: center;
				font-weight: 600;
			}
		}
		box-sizing: border-box;
		height: 100vh;
		background-color: #EDEDED;
	}
</style>
