<template>
	<view class="LoginMain">
		<view style="padding-top: 30%;">
			<uni-easyinput type="text" v-model="regnum" placeholder="请输入患者id" />
			<button  style="margin-top: 20rpx;background-color: #33cdc9;color: #fff;"   @click="LoginFunc()">登 录</button>
		</view>
	</view>
</template>

<script setup>
	import{ref,onMounted} from "vue"
	import {Login} from "@/api"
	import {onLoad} from "@dcloudio/uni-app"
	let regnum=ref('');
	const LoginFunc=()=> {
		if(regnum.value==''){
			return false;
		}
		  Login({regnum:regnum.value}).then(res => {
			  console.log(res)
			  if(res.status){
				  sessionStorage.setItem("access_token",res.data.token)
				  sessionStorage.setItem("refresh_token",res.data.refresh_token)
				  uni.reLaunch({
				  	url: '/pages/CheckItemMainList'
				  })
			  } 
		  })	
	}
	onMounted(()=>{
		//LoginFunc()
	})
</script>

<style scoped>
	.LoginMain{
		padding: 20rpx;
	}

</style>
