Files
xiaoxia-saas/apps/web/src/main.tsx
xiaoxia 0fcb77b991
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Successful in 1m6s
CI Build & Deploy Pipeline / Build Staging Web Image (push) Successful in 1m49s
CI Build & Deploy Pipeline / Build Production API Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (push) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (push) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 3m1s
CI/CD Pipeline / Unit Tests (push) Successful in 3m20s
CI/CD Pipeline / Integration Tests (push) Successful in 1m29s
CI Build & Deploy Pipeline / Build Staging API Image (push) Successful in 7m4s
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Successful in 7m54s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 45s
CI Build & Deploy Pipeline / Staging E2E Tests (push) Failing after 2m50s
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Successful in 3m28s
ci: Prettier纳入两层防御体系 (#520)
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
2026-07-18 18:08:19 +08:00

101 lines
2.3 KiB
TypeScript

/**
* 更新主入口,引入全局样式
* V21 设计系统配置
*/
import React from "react"
import ReactDOM from "react-dom/client"
import { RouterProvider } from "react-router-dom"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { ConfigProvider, App as AntApp } from "antd"
import zhCN from "antd/locale/zh_CN"
import router from "./router"
import "./index.css"
import "./styles/global.css"
// 创建 React Query 客户端
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: 1,
refetchOnWindowFocus: false,
staleTime: 5 * 60 * 1000, // 5 分钟
gcTime: 10 * 60 * 1000, // 10 分钟
},
},
})
// V21 Ant Design 主题配置 - Indigo 主色 / 大圆角
const theme = {
token: {
// 主色调 - Indigo
colorPrimary: "#4f46e5",
colorSuccess: "#10b981",
colorWarning: "#f59e0b",
colorError: "#ef4444",
colorInfo: "#4f46e5",
// 圆角 - V21 大圆角
borderRadius: 14,
borderRadiusLG: 24,
borderRadiusSM: 8,
// 文字色
colorText: "#0f172a",
colorTextSecondary: "#64748b",
colorTextTertiary: "#94a3b8",
// 背景色
colorBgContainer: "#ffffff",
colorBgLayout: "#f8fafc",
// 边框色
colorBorder: "#e2e8f0",
colorBorderSecondary: "#f1f5f9",
// 阴影
boxShadow: "0 10px 30px rgba(15, 23, 42, 0.06)",
boxShadowSecondary: "0 24px 70px rgba(15, 23, 42, 0.09)",
},
components: {
Button: {
// 按钮圆角
borderRadius: 14,
// 主按钮渐变通过 CSS 实现
colorPrimary: "#4f46e5",
colorPrimaryHover: "#6366f1",
primaryShadow: "0 14px 26px rgba(79, 70, 229, 0.22)",
},
Card: {
borderRadiusLG: 28,
paddingLG: 28,
},
Input: {
borderRadius: 14,
},
Select: {
borderRadius: 14,
},
Modal: {
borderRadiusLG: 28,
},
InputNumber: {
borderRadius: 14,
},
DatePicker: {
borderRadius: 14,
},
},
}
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<ConfigProvider locale={zhCN} theme={theme}>
<AntApp>
<RouterProvider router={router} />
</AntApp>
</ConfigProvider>
</QueryClientProvider>
</React.StrictMode>,
)