Skip to content

Commit f1b820f

Browse files
committed
fix: 修复 GitHub Pages base 路径配置
1 parent daf8758 commit f1b820f

3 files changed

Lines changed: 142 additions & 1 deletion

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 HUTAO
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# IOT-Testing - 物联网题库系统
2+
3+
![React](https://img.shields.io/badge/React-18.2-blue.svg)
4+
![Vite](https://img.shields.io/badge/Vite-5.0-646CFF.svg)
5+
![TailwindCSS](https://img.shields.io/badge/TailwindCSS-3.4-38B2AC.svg)
6+
![License](https://img.shields.io/badge/license-MIT-green.svg)
7+
8+
一个专为物联网课程设计的在线题库系统,支持单选题、多选题和判断题,提供实时答题反馈和成绩统计功能。
9+
10+
🌐 **在线访问**: [https://awfp1314.github.io/IOT-Testing/](https://awfp1314.github.io/IOT-Testing/)
11+
12+
## 📖 项目背景
13+
14+
这是一个为学校物联网课程考试准备的题库系统,帮助学生更好地复习和备考。
15+
16+
- **实际用户**: 40+ 名学生使用
17+
- **题目数量**: 涵盖物联网核心知识点
18+
- **使用场景**: 课程复习、考前练习、知识巩固
19+
20+
## ✨ 功能特性
21+
22+
- 📝 **多种题型支持** - 单选题、多选题、判断题
23+
-**实时答题反馈** - 即时显示答案正确性
24+
- 📊 **成绩统计** - 自动计算得分和正确率
25+
- 🎯 **题目解析** - 详细的答案解析帮助理解
26+
- 💾 **本地存储** - 答题记录保存在浏览器本地
27+
- 📱 **响应式设计** - 支持手机、平板、电脑多端访问
28+
- 🚀 **快速加载** - 基于 Vite 构建,秒开体验
29+
30+
## 🛠️ 技术栈
31+
32+
- **前端框架**: React 18.2
33+
- **构建工具**: Vite 5.0
34+
- **样式方案**: TailwindCSS 3.4
35+
- **图标库**: Lucide React
36+
- **数据存储**: Supabase (可选)
37+
- **部署平台**: GitHub Pages
38+
39+
## 📦 安装与运行
40+
41+
### 环境要求
42+
43+
- Node.js 16+
44+
- npm 或 yarn
45+
46+
### 本地开发
47+
48+
```bash
49+
# 克隆仓库
50+
git clone https://github.com/Awfp1314/IOT-Testing.git
51+
cd IOT-Testing
52+
53+
# 安装依赖
54+
npm install
55+
56+
# 解析题目数据
57+
npm run parse
58+
59+
# 启动开发服务器
60+
npm run dev
61+
```
62+
63+
访问 `http://localhost:5173` 查看应用。
64+
65+
### 构建部署
66+
67+
```bash
68+
# 构建生产版本
69+
npm run build
70+
71+
# 预览构建结果
72+
npm run preview
73+
```
74+
75+
## 📂 项目结构
76+
77+
```
78+
IOT-Testing/
79+
├── src/ # 源代码目录
80+
│ ├── components/ # React 组件
81+
│ ├── data/ # 题目数据
82+
│ ├── utils/ # 工具函数
83+
│ └── App.jsx # 主应用组件
84+
├── public/ # 静态资源
85+
├── scripts/ # 构建脚本
86+
│ └── parseQuestions.js # 题目解析脚本
87+
├── server/ # 服务端代码(可选)
88+
├── index.html # HTML 入口
89+
├── vite.config.js # Vite 配置
90+
└── package.json # 项目配置
91+
```
92+
93+
## 🎯 使用说明
94+
95+
1. **开始答题**: 打开应用后选择题目类型开始答题
96+
2. **查看解析**: 提交答案后可查看详细解析
97+
3. **统计成绩**: 完成所有题目后查看总体成绩
98+
4. **重新练习**: 可随时重置进度重新开始
99+
100+
## 📊 数据统计
101+
102+
- ✅ 服务学生数量: 40+
103+
- 📝 题目总数: 根据课程内容持续更新
104+
- 🎓 覆盖知识点: 物联网基础、传感器、通信协议、应用开发等
105+
106+
## 🤝 贡献
107+
108+
欢迎提交 Issue 和 Pull Request 来帮助改进项目。
109+
110+
## 📄 许可证
111+
112+
本项目采用 MIT 许可证 - 详见 [LICENSE](LICENSE) 文件
113+
114+
## 👨‍💻 作者
115+
116+
HUTAO
117+
118+
---
119+
120+
****: 本项目仅用于学习交流,题目内容来源于课程教材和公开资料。

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig({
2222
}
2323
},
2424
// GitHub Pages部署需要base路径
25-
base: process.env.NODE_ENV === 'production' ? '/-/' : './',
25+
base: process.env.NODE_ENV === 'production' ? '/IOT-Testing/' : './',
2626
// 确保正确处理路由
2727
optimizeDeps: {
2828
exclude: ['lucide-react']

0 commit comments

Comments
 (0)