feat: 区别不同的小程序的缓存问题

This commit is contained in:
2025-12-15 16:26:45 +08:00
parent 09452bf600
commit a3c363cbc9
8 changed files with 43 additions and 16 deletions

View File

@@ -159,6 +159,7 @@ import WebSocketManager from "@/utils/WebSocketManager";
import { ThrottleUtils, IdUtils } from "@/utils";
import { checkToken } from "@/hooks/useGoLogin";
import { useAppStore } from "@/store";
import { getStorageSyncToken } from "@/constant/token";
const appStore = useAppStore();
/// 导航栏相关
@@ -346,7 +347,7 @@ onLoad(() => {
// token存在初始化数据
const initHandler = () => {
console.log("initHandler");
const token = uni.getStorageSync("token");
const token = getStorageSyncToken();
if (!token) return;
loadRecentConversation();
@@ -414,7 +415,7 @@ const initWebSocket = async () => {
}
// 使用配置的WebSocket服务器地址
const token = uni.getStorageSync("token");
const token = getStorageSyncToken();
const wsUrl = `${appStore.serverConfig.wssUrl}?access_token=${token}`;
// 初始化WebSocket管理器