From 8b7384e47fe451e6aa9cabb4caeebac7bb1df051 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sat, 23 Aug 2025 01:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(home):=20build=20?= =?UTF-8?q?serverAddress=20using=20`${window.location.origin}`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the fallback assignment of serverAddress in `web/src/pages/Home/index.jsx` to use a template literal for `window.location.origin`. - Aligns with the preferred style for constructing base URLs - Keeps formatting consistent across the app - No functional changes; behavior remains the same - Lint passes with no new warnings or errors Files affected: - web/src/pages/Home/index.jsx --- web/src/components/topup/RechargeCard.jsx | 7 +------ web/src/pages/Home/index.jsx | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/web/src/components/topup/RechargeCard.jsx b/web/src/components/topup/RechargeCard.jsx index 208a0eb0..6d96217a 100644 --- a/web/src/components/topup/RechargeCard.jsx +++ b/web/src/components/topup/RechargeCard.jsx @@ -23,11 +23,8 @@ import { Typography, Card, Button, - Input, - InputNumber, Banner, Skeleton, - Divider, Form, Space, Row, @@ -35,11 +32,10 @@ import { Spin, } from '@douyinfe/semi-ui'; import { SiAlipay, SiWechat, SiStripe } from 'react-icons/si'; -import { CreditCard, Gift, Link as LinkIcon, Coins, Wallet, BarChart2, TrendingUp } from 'lucide-react'; +import { CreditCard, Coins, Wallet, BarChart2, TrendingUp } from 'lucide-react'; import { IconGift } from '@douyinfe/semi-icons'; import { useMinimumLoadingTime } from '../../hooks/common/useMinimumLoadingTime'; - const { Text } = Typography; const RechargeCard = ({ @@ -69,7 +65,6 @@ const RechargeCard = ({ isSubmitting, topUpLink, openTopUpLink, - // 新增:用于右侧统计卡片 userState, renderQuota, statusLoading, diff --git a/web/src/pages/Home/index.jsx b/web/src/pages/Home/index.jsx index ca6329b1..776de0c8 100644 --- a/web/src/pages/Home/index.jsx +++ b/web/src/pages/Home/index.jsx @@ -41,7 +41,7 @@ const Home = () => { const isMobile = useIsMobile(); const isDemoSiteMode = statusState?.status?.demo_site_enabled || false; const docsLink = statusState?.status?.docs_link || ''; - const serverAddress = statusState?.status?.server_address || window.location.origin; + const serverAddress = statusState?.status?.server_address || `${window.location.origin}`; const endpointItems = API_ENDPOINTS.map((e) => ({ value: e })); const [endpointIndex, setEndpointIndex] = useState(0); const isChinese = i18n.language.startsWith('zh');