解决不同用户登录时,我的中信息即时发生变化的bug

This commit is contained in:
hongchao 2025-02-24 09:44:53 +08:00
parent 4a11ca6af0
commit 27dfcd9756
1 changed files with 9 additions and 2 deletions

View File

@ -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