♻️ refactor(home): build serverAddress using ${window.location.origin}
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
This commit is contained in:
@@ -23,11 +23,8 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
Card,
|
Card,
|
||||||
Button,
|
Button,
|
||||||
Input,
|
|
||||||
InputNumber,
|
|
||||||
Banner,
|
Banner,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Divider,
|
|
||||||
Form,
|
Form,
|
||||||
Space,
|
Space,
|
||||||
Row,
|
Row,
|
||||||
@@ -35,11 +32,10 @@ import {
|
|||||||
Spin,
|
Spin,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { SiAlipay, SiWechat, SiStripe } from 'react-icons/si';
|
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 { IconGift } from '@douyinfe/semi-icons';
|
||||||
import { useMinimumLoadingTime } from '../../hooks/common/useMinimumLoadingTime';
|
import { useMinimumLoadingTime } from '../../hooks/common/useMinimumLoadingTime';
|
||||||
|
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|
||||||
const RechargeCard = ({
|
const RechargeCard = ({
|
||||||
@@ -69,7 +65,6 @@ const RechargeCard = ({
|
|||||||
isSubmitting,
|
isSubmitting,
|
||||||
topUpLink,
|
topUpLink,
|
||||||
openTopUpLink,
|
openTopUpLink,
|
||||||
// 新增:用于右侧统计卡片
|
|
||||||
userState,
|
userState,
|
||||||
renderQuota,
|
renderQuota,
|
||||||
statusLoading,
|
statusLoading,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const Home = () => {
|
|||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const isDemoSiteMode = statusState?.status?.demo_site_enabled || false;
|
const isDemoSiteMode = statusState?.status?.demo_site_enabled || false;
|
||||||
const docsLink = statusState?.status?.docs_link || '';
|
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 endpointItems = API_ENDPOINTS.map((e) => ({ value: e }));
|
||||||
const [endpointIndex, setEndpointIndex] = useState(0);
|
const [endpointIndex, setEndpointIndex] = useState(0);
|
||||||
const isChinese = i18n.language.startsWith('zh');
|
const isChinese = i18n.language.startsWith('zh');
|
||||||
|
|||||||
Reference in New Issue
Block a user