Skip to content

Commit dad6d91

Browse files
authored
Merge pull request #18 from weiruchenai1/experimental
refactor: 重构消息提示系统、迁移至 Vite 并完善测试基础设施
2 parents 1a5408f + c028e44 commit dad6d91

File tree

80 files changed

+14915
-18105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+14915
-18105
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
- name: Install dependencies
2626
run: npm ci
2727

28-
- name: Build project
29-
run: npm run build
28+
- name: Build project for GitHub Pages
29+
run: npm run build:pages
3030

3131
- name: Add 404.html for SPA routing
32-
run: cp build/index.html build/404.html
32+
run: cp dist/index.html dist/404.html
3333

3434
- name: Deploy to GitHub Pages
35-
uses: peaceiris/actions-gh-pages@v3
35+
uses: peaceiris/actions-gh-pages@v4
3636
with:
3737
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: build
38+
publish_dir: dist
3939
publish_branch: gh-pages
4040
user_name: github-actions[bot]
4141
user_email: 41898282+github-actions[bot]@users.noreply.github.com

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ RUN npm ci
99

1010
# 复制源码并构建
1111
COPY . .
12+
ENV DOCKER_BUILD=true
1213
RUN npm run build
1314

1415
# -------- Stage 2: Runtime (Nginx) --------
1516
FROM nginx:alpine
1617
# 自定义 Nginx 配置
1718
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
1819
# 构建产物
19-
COPY --from=build /app/build /usr/share/nginx/html
20+
COPY --from=build /app/dist /usr/share/nginx/html
2021

2122
EXPOSE 80
2223
CMD ["nginx", "-g", "daemon off;"]

README.en.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![GitHub forks](https://img.shields.io/github/forks/weiruchenai1/api-key-tester?style=flat&color=green)](https://github.com/weiruchenai1/api-key-tester/network/members)
1111

1212
[![License](https://img.shields.io/github/license/weiruchenai1/api-key-tester?style=flat&color=blue)](https://github.com/weiruchenai1/api-key-tester/blob/main/LICENSE)
13-
[![Node Version](https://img.shields.io/badge/node-%3E=16.0.0-brightgreen?style=flat&logo=node.js)](https://nodejs.org/)
13+
[![Node Version](https://img.shields.io/badge/node-%3E=20.19.0-brightgreen?style=flat&logo=node.js)](https://nodejs.org/)
1414
[![Top Language](https://img.shields.io/github/languages/top/weiruchenai1/api-key-tester?style=flat&logo=javascript&color=yellow)](https://github.com/weiruchenai1/api-key-tester)
1515

1616
[![Live Demo](https://img.shields.io/badge/Live%20Demo-GitHub%20Pages-blue?style=flat&logo=github)](https://weiruchenai1.github.io/api-key-tester)
@@ -25,7 +25,7 @@
2525
## ✨ Features
2626

2727
- 🚀 Batch test multiple API keys
28-
- 🎯 Support for OpenAI, Claude, and Gemini platforms
28+
- 🎯 Support for OpenAI, Claude, Gemini and other platforms
2929
- 🔄 Smart retry mechanism for improved detection accuracy
3030
- 🌐 Bilingual interface (Chinese/English)
3131
- 🌙 Light/Dark theme toggle
@@ -253,17 +253,17 @@ sudo nginx -s reload # Reload configuration
253253

254254
**Proxy URLs:**
255255
After successful testing, use the following proxy URLs in the API Key tester:
256-
- OpenAI: `https://openai.your-domain.com`
257-
- Claude: `https://claude.your-domain.com`
258-
- Gemini: `https://gemini.your-domain.com`
256+
- OpenAI: `https://openai.your-domain.com/v1`
257+
- Claude: `https://claude.your-domain.com/v1`
258+
- Gemini: `https://gemini.your-domain.com/v1`
259259

260260
</details>
261261

262262
## Quick Start
263263

264264
### Requirements
265265

266-
- Node.js >= 16.0.0
266+
- Node.js >= 20.19.0
267267
- npm >= 8.0.0
268268

269269
### Install Dependencies
@@ -275,7 +275,7 @@ npm install
275275
### Start Development Server
276276

277277
```bash
278-
npm start
278+
npm run dev
279279
```
280280

281281
The application will start at http://localhost:3000
@@ -286,7 +286,7 @@ The application will start at http://localhost:3000
286286
npm run build
287287
```
288288

289-
Build artifacts will be generated in the `build/` directory
289+
Build artifacts will be generated in the `dist/` directory
290290

291291
## 🚀 Deployment Options
292292

@@ -341,7 +341,7 @@ services:
341341
5. Configure build settings:
342342
- **Build command**: `npm run build`
343343
- **Build output directory**: `build`
344-
- **Node.js version**: `18` or `20`
344+
- **Node.js version**: `20` or higher
345345
6. Click `Save and Deploy`
346346

347347
### 4. Vercel Deployment

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![GitHub forks](https://img.shields.io/github/forks/weiruchenai1/api-key-tester?style=flat&color=green)](https://github.com/weiruchenai1/api-key-tester/network/members)
1111

1212
[![License](https://img.shields.io/github/license/weiruchenai1/api-key-tester?style=flat&color=blue)](https://github.com/weiruchenai1/api-key-tester/blob/main/LICENSE)
13-
[![Node Version](https://img.shields.io/badge/node-%3E=16.0.0-brightgreen?style=flat&logo=node.js)](https://nodejs.org/)
13+
[![Node Version](https://img.shields.io/badge/node-%3E=20.19.0-brightgreen?style=flat&logo=node.js)](https://nodejs.org/)
1414
[![Top Language](https://img.shields.io/github/languages/top/weiruchenai1/api-key-tester?style=flat&logo=javascript&color=yellow)](https://github.com/weiruchenai1/api-key-tester)
1515

1616
[![在线使用](https://img.shields.io/badge/在线使用-GitHub%20Pages-blue?style=flat&logo=github)](https://weiruchenai1.github.io/api-key-tester)
@@ -25,7 +25,7 @@
2525
## ✨ 功能
2626

2727
- 🚀 批量测试多个 API 密钥
28-
- 🎯 支持 OpenAI、Claude、Gemini 三大平台
28+
- 🎯 支持 OpenAI、Claude、Gemini 等平台
2929
- 🔄 智能重试机制,提高检测准确性
3030
- 🌐 中英文界面切换
3131
- 🌙 浅色/深色主题切换
@@ -253,17 +253,17 @@ sudo nginx -s reload # 重新加载配置
253253

254254
**代理地址:**
255255
测试成功后,在API Key测试工具中使用以下代理地址:
256-
- OpenAI: `https://openai.your-domain.com`
257-
- Claude: `https://claude.your-domain.com`
258-
- Gemini: `https://gemini.your-domain.com`
256+
- OpenAI: `https://openai.your-domain.com/v1`
257+
- Claude: `https://claude.your-domain.com/v1`
258+
- Gemini: `https://gemini.your-domain.com/v1`
259259

260260
</details>
261261

262262
## 快速开始
263263

264264
### 环境要求
265265

266-
- Node.js >= 16.0.0
266+
- Node.js >= 20.19.0
267267
- npm >= 8.0.0
268268

269269
### 安装依赖
@@ -275,7 +275,7 @@ npm install
275275
### 启动开发服务器
276276

277277
```bash
278-
npm start
278+
npm run dev
279279
```
280280

281281
应用将在 http://localhost:3000 启动
@@ -286,7 +286,7 @@ npm start
286286
npm run build
287287
```
288288

289-
构建产物将生成到 `build/` 目录
289+
构建产物将生成到 `dist/` 目录
290290

291291
## 🚀 部署方式
292292

@@ -340,8 +340,8 @@ services:
340340
4. 选择你 Fork 的仓库
341341
5. 配置构建设置:
342342
- **构建命令**: `npm run build`
343-
- **构建输出目录**: `build`
344-
- **Node.js 版本**: `18` 或 `20`
343+
- **构建输出目录**: `dist`
344+
- **Node.js 版本**: `20` 或更高
345345
6. 点击 `Save and Deploy`
346346

347347
### 4. Vercel 部署
@@ -358,7 +358,7 @@ services:
358358
# 构建项目
359359
npm run build
360360
361-
# 将 build 目录的内容上传到你的 Web 服务器
361+
# 将 dist 目录的内容上传到你的 Web 服务器
362362
# 确保服务器配置了正确的路由规则(SPA 支持)
363363
```
364364

@@ -367,7 +367,7 @@ npm run build
367367
server {
368368
listen 80;
369369
server_name your-domain.com;
370-
root /path/to/build;
370+
root /path/to/dist;
371371
index index.html;
372372
373373
location / {
@@ -395,7 +395,8 @@ server {
395395

396396
## 🛠️ 技术栈
397397

398-
纯前端:HTML + CSS + JavaScript
398+
- **前端框架**: React 19
399+
- **构建工具**: Vite 7
399400

400401
## 📄 许可证
401402

public/index.html renamed to index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
<meta name="theme-color" content="#667eea">
88
<meta name="description" content="批量检测 Gemini、Claude、GPT API 密钥有效性">
99
<title>API Key 测活工具</title>
10-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
10+
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
11+
<link rel="manifest" href="/manifest.json">
1112
</head>
1213

1314
<body>
1415
<noscript>您需要启用 JavaScript 来运行此应用程序。</noscript>
1516
<div id="root"></div>
17+
<script type="module" src="/src/index.jsx"></script>
1618
</body>
1719

1820
</html>

0 commit comments

Comments
 (0)