wwf
12 小时以前 9a6cd220224fd3a9a6c84b5bb37c6410a470969f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<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>