From 95218676dbf86022ca65e7289e003e6d39e3361c Mon Sep 17 00:00:00 2001 From: Supra4E8C Date: Thu, 11 Dec 2025 00:17:52 +0800 Subject: [PATCH] feat: update document title and favicon in main.tsx, remove isLocalhost check from OAuthPage for cleaner logic, and enhance overall user experience --- src/main.tsx | 15 +++++++++++++++ src/pages/OAuthPage.tsx | 9 +-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 9a2a810..530bfc6 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,8 +1,23 @@ import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import '@/styles/global.scss'; +import { INLINE_LOGO_JPEG } from '@/assets/logoInline'; import App from './App.tsx'; +document.title = 'CLI Proxy API Management Center'; + +const faviconEl = document.querySelector('link[rel="icon"]'); +if (faviconEl) { + faviconEl.href = INLINE_LOGO_JPEG; + faviconEl.type = 'image/jpeg'; +} else { + const newFavicon = document.createElement('link'); + newFavicon.rel = 'icon'; + newFavicon.type = 'image/jpeg'; + newFavicon.href = INLINE_LOGO_JPEG; + document.head.appendChild(newFavicon); +} + createRoot(document.getElementById('root')!).render( diff --git a/src/pages/OAuthPage.tsx b/src/pages/OAuthPage.tsx index b5a15e4..7967c70 100644 --- a/src/pages/OAuthPage.tsx +++ b/src/pages/OAuthPage.tsx @@ -1,10 +1,9 @@ -import { useEffect, useMemo, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Card } from '@/components/ui/Card'; import { Button } from '@/components/ui/Button'; import { useNotificationStore } from '@/stores'; import { oauthApi, type OAuthProvider } from '@/services/api/oauth'; -import { isLocalhost } from '@/utils/connection'; interface ProviderState { url?: string; @@ -29,8 +28,6 @@ export function OAuthPage() { const [states, setStates] = useState>({} as Record); const timers = useRef>({}); - const isLocal = useMemo(() => isLocalhost(window.location.hostname), []); - useEffect(() => { return () => { Object.values(timers.current).forEach((timer) => window.clearInterval(timer)); @@ -106,10 +103,6 @@ export function OAuthPage() { } }; - if (!isLocal) { - return OAuth is only available on localhost.; - } - return (
{PROVIDERS.map((provider) => {