新增IM聊天

This commit is contained in:
geht
2026-05-28 14:37:05 +08:00
parent 99e574f600
commit 3539eab924
35 changed files with 2864 additions and 36 deletions

View File

@@ -198,6 +198,8 @@ export const useUserStore = defineStore({
await this.setLoginInfo({ ...data, isLogin: true });
// 代码逻辑说明: 登录成功后缓存拖拽模块的接口前缀
localStorage.setItem(JDragConfigEnum.DRAG_BASE_URL, useGlobSetting().domainUrl);
// 登录后异步预取 IM 聊天数据,减少打开聊天时的等待
import('/@/views/system/im/imCache').then(({ prefetchImChatData }) => prefetchImChatData());
// 代码逻辑说明: 修复登录成功后,没有正确重定向的问题
let redirect = router.currentRoute.value?.query?.redirect as string;
@@ -284,6 +286,9 @@ export const useUserStore = defineStore({
}
}
// 退出登录前清除 IM 聊天缓存
import('/@/views/system/im/imCache').then(({ clearImCache }) => clearImCache());
// let username:any = this.userInfo && this.userInfo.username;
// if(username){
// removeAuthCache(username)