<script setup>
	/**
	 * name：
	 * user：sa0ChunLuyu
	 * date：2022-04-19 14:58:23
	 */
	import {
		ref
	} from 'vue'
	import {
		getUserInfoAction
	} from '@/api/index.js'
	import {
		getToken
	} from '@/tool/member.js'
	const mask_show = ref(true)
	const login_show = ref(true)

	import {
		onShow
	} from '@dcloudio/uni-app'

	onShow(() => {
		getUserInfo()
	})

	const toLogin = () => {
		uni.navigateTo({
			url: '/pages/main/login/login'
		})
	}
	const getUserInfo = () => {
		login_show.value = true
		mask_show.value = true
		if (getToken()) {
			getUserInfoAction((info) => {
				login_show.value = false
				mask_show.value = false
			}, false)
		}
	}

	defineExpose({
		getUserInfo
	})
</script>
<template>
	<view v-if="login_show">
		<u-mask :custom-style="{
			opacity: 0
		}" :show="mask_show" @click="toLogin()"></u-mask>
	</view>
</template>
<style scoped>
</style>
