perf: 调整

This commit is contained in:
rd
2025-09-18 18:05:17 +08:00
parent c02631f4ee
commit 55b4ed1e83
3 changed files with 8 additions and 6 deletions

View File

@ -25,12 +25,12 @@
>
<div class="flex mr-4px overflow-hidden h-24px lh-24px items-center">
<div class="cursor-pointer mr-4px">
<Avatar v-if="userInfo.head_image" :size="24" :src="userInfo.head_image" />
<Avatar v-if="userData.head_image" :size="24" :src="userData.head_image" />
<div v-else class="w-24px h-24px rounded-50% bg-#6D4CFE flex items-center justify-center">
<span class="color-#FFF text-11px font-400 lh-20px">{{ userInfo.mobile?.slice(-3) }}</span>
<span class="color-#FFF text-11px font-400 lh-20px">{{ userData.mobile?.slice(-3) }}</span>
</div>
</div>
<TextOverTips :context="userInfo.name || userInfo.mobile" />
<TextOverTips :context="userData.name || userData.mobile" />
</div>
<icon-caret-down class="icon-caret color-#939499" size="14" />
@ -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 ?? {};
});

View File

@ -39,6 +39,7 @@ export const useChatStore = defineStore('chat', {
clearAgentInfo() {
this.agentInfo = {};
this.searchValue = '';
rlsWithCatch('agentInfo');
},
async onCreateSession() {
const { code, data } = await createSession();

View File

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