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.

56 lines
939 B
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
* date2022-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>