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.

84 lines
1.4 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<script setup>
/**
* name
* usersa0ChunLuyu
* date2023年6月8日 19:26:33
*/
import {
ref
} from 'vue'
import {
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
setToken
} from '@/lu/token.js'
const $props = defineProps({
token: {
type: String,
default: ''
},
page: {
type: String,
default: 'home'
},
orderid: {
type: String,
default: ''
},
param: {
type: String,
default: ''
},
hospital: {
type: String,
default: '0'
}
});
const tip_content = ref('正在校验')
const getUserInfo = () => {
setToken($props.token)
uni.$lu.user((info) => {
if (!!info.id) {
tip_content.value = '登录成功'
let param = decodeURIComponent($props.param)
let page = !!$props.page ? $props.page : 'home'
let orderid=!!$props.orderid ? $props.orderid : ''
param = !!param ? '&' + param : ''
uni.reLaunch({
url: `/pages/main/${page}/${page}?hospital=${$props.hospital}${param}&orderid=${$props.orderid}`
})
} else {
tip_content.value = '登录失败'
}
}, () => {
tip_content.value = '登录失败'
})
}
onShow(() => {
getUserInfo()
})
</script>
<template>
<view>
<view class="tip_wrapper">{{ tip_content }}</view>
</view>
</template>
<style scoped>
.tip_wrapper {
position: fixed;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 30rpx;
font-weight: bold;
}
</style>