<template>
|
<div v-if="userInfo.id">
|
<router-view></router-view>
|
</div>
|
</template>
|
<script>
|
import { useSessionStore } from '@/stores/session.js'
|
import { storeToRefs } from 'pinia';
|
export default {
|
setup() {
|
const { setUserInfo } = useSessionStore()
|
const { userInfo } = storeToRefs(useSessionStore())
|
return { setUserInfo, userInfo }
|
},
|
data() {
|
return {}
|
},
|
created() {
|
if (this.$route.path == '/h5/verify' && this.$route.query.appId) {
|
localStorage.setItem('verify_url', this.$route.fullPath)
|
}
|
this.getUserInfo()
|
},
|
methods: {
|
getUserInfo() {
|
this.$axios.get('/system/auth/staff/profile').then(res => {
|
if (res.data.code == 0) {
|
this.setUserInfo(res.data.data || {})
|
}
|
})
|
},
|
}
|
}
|
</script>
|