From ddc461f548b0667a7481f558bc9df1855be8e260 Mon Sep 17 00:00:00 2001 From: "DESKTOP-JKIE562\\PC" <1013397054@qq.com> Date: Wed, 20 May 2026 18:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82=E9=85=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/dist/index.html | 4 +- frontend/src/router/index.ts | 6 - frontend/src/views/ChatView.vue | 4 +- frontend/src/views/ProfileView.vue | 485 --------------------------- frontend/src/views/WorkspaceView.vue | 66 +++- 5 files changed, 62 insertions(+), 503 deletions(-) delete mode 100644 frontend/src/views/ProfileView.vue diff --git a/frontend/dist/index.html b/frontend/dist/index.html index d2738eba..88a1fad1 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -10,8 +10,8 @@ AI工作台 - - + +
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 7d2baf8b..2af810a5 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -4,7 +4,6 @@ import { createRouter, createWebHistory } from 'vue-router'; import WorkspaceView from '../views/WorkspaceView.vue'; import ChatView from '../views/ChatView.vue'; import AdminView from '../views/AdminView.vue'; -import ProfileView from '../views/ProfileView.vue'; import ResetPasswordView from '../views/ResetPasswordView.vue'; import KbWorkspaceView from '../views/KbWorkspaceView.vue'; import KbAdminView from '../views/KbAdminView.vue'; @@ -27,11 +26,6 @@ const routes = [ name: 'CasdoorCallback', component: WorkspaceView }, - { - path: '/profile', - name: 'Profile', - component: ProfileView - }, { path: '/reset-password', name: 'ResetPassword', diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index 6b303fa6..50e893c4 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -13,7 +13,7 @@ import { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue'; import { useI18n } from 'vue-i18n'; import { useChat } from '../composables/useChat'; -import { Send, Loader2, Plus, Copy, Edit2, RotateCw, Check, X, PanelLeftClose, PanelLeftOpen, Heart, Bell, Mail, Settings, ChevronDown, Sparkles, Database, Mic, LogOut, MessageSquareText, Globe, ExternalLink, Search, LayoutGrid, UserCircle, Menu } from 'lucide-vue-next'; +import { Send, Loader2, Plus, Copy, Edit2, RotateCw, Check, X, PanelLeftClose, PanelLeftOpen, Heart, Bell, Mail, Settings, ChevronDown, Sparkles, Database, Mic, LogOut, MessageSquareText, Globe, ExternalLink, Search, LayoutGrid, UserCircle } from 'lucide-vue-next'; import { marked } from 'marked'; import { useRoute, useRouter } from 'vue-router'; import { config } from '../config'; @@ -1873,7 +1873,7 @@ const showChatRating = ref(false);
AI
{{ currentAgent?.name || 'AI' }} - diff --git a/frontend/src/views/ProfileView.vue b/frontend/src/views/ProfileView.vue deleted file mode 100644 index f11d0390..00000000 --- a/frontend/src/views/ProfileView.vue +++ /dev/null @@ -1,485 +0,0 @@ - - - diff --git a/frontend/src/views/WorkspaceView.vue b/frontend/src/views/WorkspaceView.vue index 1b55e015..709f185e 100644 --- a/frontend/src/views/WorkspaceView.vue +++ b/frontend/src/views/WorkspaceView.vue @@ -5,7 +5,7 @@ * 引用文件:vue, vue-router, lucide-vue-next, 后端 /api/user 接口 */ import { ref, onMounted, computed, watch, nextTick } from 'vue'; -import { useRouter } from 'vue-router'; +import { useRouter, useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { config } from '../config'; import { useTheme } from '../composables/useTheme'; @@ -48,7 +48,8 @@ import { Megaphone, X, ChevronDown, - ChevronUp + ChevronUp, + MessageCircle } from 'lucide-vue-next'; import KbWorkspaceView from './KbWorkspaceView.vue'; @@ -58,6 +59,7 @@ import { Clock, Download, Search, RefreshCw } from 'lucide-vue-next'; const { t, locale } = useI18n(); const { showMessageDialog } = useGlobalMessageDialog(); const router = useRouter(); +const route = useRoute(); const { setThemePreference, appliedTheme } = useTheme(); const { isMobile } = useIsMobile(); const loginBackgroundStyle = { @@ -812,6 +814,30 @@ const hasProfileUnsavedChanges = computed(() => { ); }); +const mobileTabActive = computed({ + get: () => { + if (activeSidebarItem.value === 'profile') return 'profile'; + if (activeSidebarItem.value === 'feedback') return 'feedback'; + return 'applications'; + }, + set: (tab: string) => { + if (tab === 'profile') { + activeSidebarItem.value = 'profile'; + if (!profileUser.value.id) fetchProfile(); + } else if (tab === 'feedback') { + activeSidebarItem.value = 'feedback'; + } else { + activeSidebarItem.value = 'applications'; + } + }, +}); + +const mobileTabTitle = computed(() => { + if (mobileTabActive.value === 'profile') return '我的'; + if (mobileTabActive.value === 'feedback') return '意见反馈'; + return '应用管理'; +}); + const handleLogout = () => { localStorage.removeItem('hxops_user'); sessionStorage.removeItem('hxops_user'); @@ -1304,6 +1330,14 @@ onMounted(async () => { if (currentUser.value && currentUser.value.role !== 'guest') { await fetchHome(); await handleWecomDeeplinkContext(); + const viewParam = route.query.view as string; + const validViews: string[] = ['profile', 'applications', 'feedback', 'updates', 'knowledge_base', 'schedule_runs']; + if (viewParam && validViews.includes(viewParam)) { + activeSidebarItem.value = viewParam as typeof activeSidebarItem.value; + if (viewParam === 'profile' && !profileUser.value.id) { + await fetchProfile(); + } + } } else { await fetchPublicAgents(); isLoading.value = false; @@ -1471,12 +1505,9 @@ onMounted(async () => {
-
AI
- 和信AI + + {{ mobileTabTitle }}
-
-
+
+ +