From 55b4ed1e839aa62decd741567e41e8cad4cd656a Mon Sep 17 00:00:00 2001
From: rd <1344903914@qq.com>
Date: Thu, 18 Sep 2025 18:05:17 +0800
Subject: [PATCH] =?UTF-8?q?perf:=20=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/navbar/components/right-side/index.vue | 9 +++++----
src/stores/modules/chat/index.ts | 1 +
src/stores/modules/enterprise/index.ts | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/layouts/components/navbar/components/right-side/index.vue b/src/layouts/components/navbar/components/right-side/index.vue
index c9f0ff5..f49942b 100644
--- a/src/layouts/components/navbar/components/right-side/index.vue
+++ b/src/layouts/components/navbar/components/right-side/index.vue
@@ -25,12 +25,12 @@
>
-
+
- {{ userInfo.mobile?.slice(-3) }}
+ {{ userData.mobile?.slice(-3) }}
-
+
@@ -184,7 +184,8 @@ const primary_enterprise = computed(() => userStore.userInfo?.primary_enterprise
const enterprises = computed(() => {
return userStore.userInfo?.enterprises ?? [];
});
-const userInfo = computed(() => userStore.userInfo);
+const userData = computed(() => userStore.userInfo ?? {});
+
const enterpriseInfo = computed(() => {
return enterpriseStore?.enterpriseInfo ?? {};
});
diff --git a/src/stores/modules/chat/index.ts b/src/stores/modules/chat/index.ts
index 47da668..a333c34 100644
--- a/src/stores/modules/chat/index.ts
+++ b/src/stores/modules/chat/index.ts
@@ -39,6 +39,7 @@ export const useChatStore = defineStore('chat', {
clearAgentInfo() {
this.agentInfo = {};
this.searchValue = '';
+ rlsWithCatch('agentInfo');
},
async onCreateSession() {
const { code, data } = await createSession();
diff --git a/src/stores/modules/enterprise/index.ts b/src/stores/modules/enterprise/index.ts
index 44b5477..ad6b53b 100644
--- a/src/stores/modules/enterprise/index.ts
+++ b/src/stores/modules/enterprise/index.ts
@@ -1,5 +1,5 @@
import { fetchEnterpriseInfo } from '@/api/all/login';
-import { glsWithCatch, slsWithCatch } from '@/utils/stroage';
+import { glsWithCatch, slsWithCatch, rlsWithCatch } from '@/utils/stroage';
interface EnterpriseInfo {
id: number | string;
@@ -34,7 +34,7 @@ export const useEnterpriseStore = defineStore('enterprise', {
},
clearUserEnterpriseInfo() {
this.enterpriseInfo = null;
- localStorage.removeItem('enterpriseInfo');
+ rlsWithCatch('enterpriseInfo');
},
setEnterpriseName(name: string) {
if (this.enterpriseInfo) {