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

<script setup>
	import {
		ref
	} from "vue"
	 
	import {
		WXGetOpenid
	} from "@/api"
	import {
		onLoad
	} from "@dcloudio/uni-app"
	 let code=ref('')
	const WXGetOpenidFuc = () => {
		WXGetOpenid({code:code.value}).then(res => {
			if (res.status) { 
				sessionStorage.setItem("access_token", res.data.token)
				sessionStorage.setItem("refresh_token", res.data.refresh_token) 
				uni.reLaunch({
					url:'/pages/user/list'
				})
			}
		})
	}
	onLoad((option) => { 
		code.value=option.code
		 WXGetOpenidFuc()
	})
</script>

<style>

</style>
