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.
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:
* 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 >