<template>
	<view>
	</view>
</template>

<script>
	export default {
		onLoad(options) {
			this.$Request.get("/app/wx/wxCallBack", options).then(res => {
				console.log(res)
				if(res.openid){
					let userId = uni.getStorageSync('userId')
					console.log('userId',userId);
					this.$Request.postJson("/user/updateUserWxOpenIdByUserId", {wxOpenId:res.openid,userId}).then(r => {
						console.log("/user/updateUserWxOpenIdByUserId",r);
						uni.switchTab({
							url:'/pages/index/index',
						})
						
					})
				}
			});
		}
	}
</script>

<style scoped>

</style>