feat: 调整登录逻辑
This commit is contained in:
@@ -97,12 +97,18 @@
|
||||
/>
|
||||
|
||||
<ActivityListComponent
|
||||
v-if="mainPageDataModel.activityList && mainPageDataModel.activityList.length > 0"
|
||||
v-if="
|
||||
mainPageDataModel.activityList &&
|
||||
mainPageDataModel.activityList.length > 0
|
||||
"
|
||||
:activityList="mainPageDataModel.activityList"
|
||||
/>
|
||||
|
||||
<RecommendPostsComponent
|
||||
v-if="mainPageDataModel.recommendTheme && mainPageDataModel.recommendTheme.length > 0"
|
||||
v-if="
|
||||
mainPageDataModel.recommendTheme &&
|
||||
mainPageDataModel.recommendTheme.length > 0
|
||||
"
|
||||
:recommendThemeList="mainPageDataModel.recommendTheme"
|
||||
/>
|
||||
</ChatCardOther>
|
||||
@@ -165,6 +171,7 @@ import WebSocketManager from "@/utils/WebSocketManager";
|
||||
import TypewriterManager from "@/utils/TypewriterManager";
|
||||
import { IdUtils } from "@/utils";
|
||||
import { useAppStore } from "@/store";
|
||||
import { checkToken } from "@/hooks/useGoLogin";
|
||||
|
||||
const appStore = useAppStore();
|
||||
/// 导航栏相关
|
||||
@@ -346,14 +353,18 @@ onLoad(() => {
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
onMounted(() => {
|
||||
try {
|
||||
getMainPageData();
|
||||
await loadRecentConversation();
|
||||
loadConversationMsgList();
|
||||
addNoticeListener();
|
||||
initTypewriterManager();
|
||||
initWebSocket();
|
||||
|
||||
// 有token时,加载最近会话、最近消息、初始化socket
|
||||
checkToken().then(async () => {
|
||||
await loadRecentConversation();
|
||||
loadConversationMsgList();
|
||||
initWebSocket();
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("页面初始化错误:", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user