# softhub-web **Repository Path**: xjh201215/softhub-web ## Basic Information - **Project Name**: softhub-web - **Description**: softhub-web前端项目 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-15 - **Last Updated**: 2026-06-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SoftHub Web > 纯净软件下载站前端 · React 18 + Vite 5 + TypeScript + Ant Design 5 + Tailwind 3 ## 快速开始 ```bash npm install npm run dev # http://localhost:5173 ``` > 第一次安装如果慢,把 npm registry 切到 npmmirror: > ```bash > npm config set registry https://registry.npmmirror.com > ``` ## 后端代理 开发期 `vite.config.ts` 会把 `/api/*` 反代到 `VITE_API_BASE`(默认 `http://localhost:8080`)。 修改 `.env` 中的 `VITE_API_BASE` 即可切换后端地址。 ## 脚本 | 命令 | 作用 | | --- | --- | | `npm run dev` | 启动开发服务器 | | `npm run build` | 类型检查 + 生产构建 | | `npm run preview` | 预览构建产物 | | `npm run typecheck` | 仅做 TS 检查 | | `npm run lint` | ESLint | | `npm run format` | Prettier 格式化 | ## 目录结构 ``` src/ ├── api/ # Axios 客户端 + 业务 API 聚合 ├── components/ # 公共组件 ├── layouts/ # 路由布局(AuthLayout / AppLayout) ├── router/ # 路由表 ├── stores/ # Zustand stores (auth, app) ├── styles/ # 全局 CSS + Antd 主题 ├── types/ # 与后端对齐的 API 类型 ├── utils/ # 工具函数 ├── views/ # 页面级组件 ├── main.tsx # 入口 └── vite-env.d.ts ``` ## 设计规范 - **暗色优先**,通过 `useAppStore().theme` 切换;亮色下所有 .glass 玻璃态需要单独适配 - **主色**:`#165DFF` (Tailwind `primary.500`) - **背景**:`#0F172A` (暗) / `#F7F8FA` (亮) - **圆角**:卡片 16,按钮 12,标签 8 - **字体**:Inter + PingFang SC + Microsoft YaHei - **动效**:`fade-up .28s` / `pulse-slow 2.4s`,避免花哨 ## 联调状态 - ✅ 资源列表 / 详情 / 重新检测 - ✅ 分类树 / 上传者联想 - ✅ 批量下载 aria2 / txt / URL - ✅ 文件上传(MinIO 预签名) - ⚠ 登录鉴权:当前为本地 mock,后端 JWT 接口就绪后替换 `views/LoginPage.tsx` 中的 `setAuth` 调用即可 - ⚠ 分类增删改:UI 已通,后端接口未联调(默认 list 已可工作) ## License MIT