<script>
	globalData:{
		classCurrent:''
	}
	export default {
		onLaunch: function() {
			uni.login({
				provider: 'weixin',
				success: (res) => {
					if (res.code) {
						let data = {
							code: res.code
							// code:'mead'
						}
						console.log(res.code,'code--')
						this.$u.post('/auth/weapp-login',data).then(res => {
							console.log(res, '获取token---')
						    this.$u.vuex('vuex_token',res.data.token);
							this.$u.vuex('vuex_session_key',res.data.session_key);
							this.$u.vuex('vuex_is_auth',res.data.is_auth);
							this.$u.vuex('vuex_user',res.data.user);
							
							console.log(this.vuex_is_auth,'缓存')
						})

					}

				}
			});

		},
		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: #F5F5F5;
	}

</style>
