diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 3ed2c41..f58189a 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -58,9 +58,8 @@ function AuthenticatedApp() { const isCompactShell = compactMode; const hideHeader = route.kind === 'dashboard' && compactMode; const forcedBot = forcedBotId ? activeBots[forcedBotId] : undefined; - const fromPanelOpen = typeof window !== 'undefined' && (new URLSearchParams(window.location.search).get('from_panel') || '').trim() === '1'; const shouldPromptSingleBotPassword = Boolean( - route.kind === 'bot' && forcedBotId && forcedBot?.has_access_password && !singleBotUnlocked && !fromPanelOpen, + route.kind === 'bot' && forcedBotId && forcedBot?.has_access_password && !singleBotUnlocked, ); useEffect(() => { diff --git a/frontend/src/modules/platform/PlatformDashboardPage.tsx b/frontend/src/modules/platform/PlatformDashboardPage.tsx index 3e695cd..a6c94fc 100644 --- a/frontend/src/modules/platform/PlatformDashboardPage.tsx +++ b/frontend/src/modules/platform/PlatformDashboardPage.tsx @@ -34,7 +34,6 @@ import { useLucentPrompt } from '../../components/lucent/LucentPromptProvider'; import { LucentIconButton } from '../../components/lucent/LucentIconButton'; import { PlatformSettingsModal } from './components/PlatformSettingsModal'; import { TemplateManagerModal } from './components/TemplateManagerModal'; -import { appendPanelAccessPassword } from '../../utils/panelAccess'; import { normalizePlatformPageSize, readCachedPlatformPageSize, @@ -73,10 +72,7 @@ function formatDateTime(value: string | null | undefined, locale: string) { function buildBotPanelHref(botId: string) { const encodedId = encodeURIComponent(String(botId || '').trim()); - const params = new URLSearchParams(); - params.set('from_panel', '1'); - const query = params.toString(); - return appendPanelAccessPassword(`/bot/${encodedId}${query ? `?${query}` : ''}`); + return `/bot/${encodedId}`; } interface PlatformDashboardPageProps { @@ -809,7 +805,7 @@ export function PlatformDashboardPage({ compactMode }: PlatformDashboardPageProp event.stopPropagation(); void toggleBot(bot); }} - disabled={!enabled || operatingBotId === bot.id} + disabled={operatingBotId === bot.id} tooltip={running ? (isZh ? '停止' : 'Stop') : (isZh ? '启动' : 'Start')} aria-label={running ? (isZh ? '停止' : 'Stop') : (isZh ? '启动' : 'Start')} > diff --git a/frontend/src/utils/botAccess.ts b/frontend/src/utils/botAccess.ts index 2c06fc9..9ad1b2b 100644 --- a/frontend/src/utils/botAccess.ts +++ b/frontend/src/utils/botAccess.ts @@ -1,6 +1,4 @@ import axios from 'axios'; -import { appendPanelAccessPassword } from './panelAccess'; - let initialized = false; const memoryMap = new Map(); @@ -67,7 +65,7 @@ export function isBotUnauthorizedError(error: any, botId?: string): boolean { } export function buildMonitorWsUrl(base: string, botId: string): string { - return appendPanelAccessPassword(`${String(base || '').replace(/\/$/, '')}/${encodeURIComponent(botId)}`); + return `${String(base || '').replace(/\/$/, '')}/${encodeURIComponent(botId)}`; } export function setupBotAccessAuth(): void {