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

<script setup>
	import {
		ref
	} from 'vue'
	import {
		XcxGetUserInfoAction,
		$image,
		$response
	} from '@/api'
	import {
		onShow,onLoad
	} from '@dcloudio/uni-app'
	const $props = defineProps({
		hospital: {
			type: String,
			default: ''
		},
	});
	const id_number = ref('')
	const token = ref('')
	
	const GetUserInfo = async () => {
		const response = await XcxGetUserInfoAction({
			token:token.value
		})
		$response(response, () => {
			id_number.value = response.data.id_number
			if(id_number.value){
				uni.navigateTo({
					url: `/pages/main/list/list?hospital=1&id_number=${id_number.value}`
				})
			}else{
				uni.$lu.toast("身份证不能为空")
			}
		})
	}
	
	onLoad((e)=>{
		token.value=e.token
		GetUserInfo()
		// return false;
		// try{
		// 	if(token.value.length>18){
		// 		let base64Str=decodeURIComponent(token.value)
		// 		token.value=atob(base64Str)
		// 	}
		// }catch(e){
		// 	  console.error('解码失败', e)
		// 	uni.$lu.toast("解码失败"+e)
		// 	return false
		// }
	
		
		
	})
</script>

<style>

</style>
