You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
927 B
Vue
41 lines
927 B
Vue
<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>
|