解决不同用户登录时,我的中信息即时发生变化的bug
This commit is contained in:
parent
4a11ca6af0
commit
27dfcd9756
|
|
@ -9,11 +9,18 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue'
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { useMemberStore } from '@/stores'
|
||||
const memberStore = useMemberStore()
|
||||
|
||||
const userInfo = memberStore.userInfo || reactive({})
|
||||
// const userInfo = memberStore.userInfo || reactive({})
|
||||
const userInfo = ref(memberStore.userInfo || {})
|
||||
|
||||
|
||||
// 监听 memberStore.userInfo 的变化
|
||||
watch(() => memberStore.userInfo, (newUserInfo) => {
|
||||
userInfo.value = newUserInfo
|
||||
})
|
||||
|
||||
const onExit = () => {
|
||||
// 清除token 和用户信息 并返回登录页
|
||||
|
|
|
|||
Loading…
Reference in New Issue