From 3a8d7e9fc801088866eb95817c530a328c57f02d Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 04 十二月 2024 16:05:21 +0800 Subject: [PATCH] 反复刷新 bug --- src/layout/component/sidebar/components/UserInformation.vue | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/layout/component/sidebar/components/UserInformation.vue b/src/layout/component/sidebar/components/UserInformation.vue index 2245311..172b3f8 100644 --- a/src/layout/component/sidebar/components/UserInformation.vue +++ b/src/layout/component/sidebar/components/UserInformation.vue @@ -38,6 +38,9 @@ //#region ====================== 鎴戠殑淇℃伅 ====================== import { onMounted, ref } from 'vue'; import { useUserInfo } from '/@/stores/userInfo'; +import { accessSessionKey, handleNoAuth } from '/@/utils/request'; +import { Local } from '/@/utils/storage'; +import { userInfo } from '/@/stores/chatRoom'; const isShowInformation = defineModel({ type: Boolean, }); @@ -48,9 +51,11 @@ }; //#endregion onMounted(async () => { - const stores = useUserInfo(); - let userInfo = (await stores.getUserInfo()) as any; - userInformationInfo.value = userInfo; + if(!Local.get(accessSessionKey)){ + handleNoAuth() + return; + } + userInformationInfo.value = userInfo.get(); }); </script> <style scoped lang="scss"></style> -- Gitblit v1.9.3