diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index b72ddcd..76547fb 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -1,6 +1,6 @@
import { useState, useEffect, useRef } from 'react'
-import { NavLink, useLocation } from 'react-router-dom'
-import { Home, MessageSquare, BarChart3, Users, FileText, Settings, ChevronLeft, ChevronRight, Download, Aperture, UserCircle, Lock, ChevronUp, Trash2 } from 'lucide-react'
+import { NavLink, useLocation, useNavigate } from 'react-router-dom'
+import { Home, MessageSquare, BarChart3, Users, FileText, Settings, ChevronLeft, ChevronRight, Download, Aperture, UserCircle, Lock, LockOpen, ChevronUp, Trash2 } from 'lucide-react'
import { useAppStore } from '../stores/appStore'
import * as configService from '../services/config'
import { onExportSessionStatus, requestExportSessionStatus } from '../services/exportBridge'
@@ -64,6 +64,7 @@ const normalizeAccountId = (value?: string | null): string => {
function Sidebar() {
const location = useLocation()
+ const navigate = useNavigate()
const [collapsed, setCollapsed] = useState(false)
const [authEnabled, setAuthEnabled] = useState(false)
const [activeExportTaskCount, setActiveExportTaskCount] = useState(0)
@@ -465,16 +466,20 @@ function Sidebar() {
- {authEnabled && (
-
- )}
+
{
+ const initialTab = (location.state as { initialTab?: SettingsTab } | null)?.initialTab
+ if (!initialTab) return
+ setActiveTab(initialTab)
+ }, [location.state])
+
// 点击外部关闭下拉框
useEffect(() => {
const handleClickOutside = (e: MouseEvent) => {