Files
dianming/启动说明.md
2026-04-25 10:09:16 +08:00

87 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 点名系统启动说明
## 🚀 快速启动步骤
### 1. 启动后端服务器
打开命令行CMD或PowerShell进入项目目录
```bash
cd d:\!!代码\web\手机点名器
node server.js
```
看到以下提示表示启动成功:
```
点名系统服务器已启动
访问地址: http://localhost:3000
后台管理: http://localhost:3000/admin.html
用户点名: http://localhost:3000/index.html
```
### 2. 访问系统
在浏览器中打开以下地址:
- **后台管理**: http://localhost:3000/admin.html
- **用户点名**: http://localhost:3000/index.html
### 3. 登录后台
- 用户名: `admin`
- 密码: `admin123`
## ❌ 常见错误解决
### 错误1: "Failed to fetch" 或 "无法连接到服务器"
**原因**: 后端服务器未启动
**解决方法**:
1. 确认已执行 `node server.js`
2. 检查命令行是否显示"服务器已启动"
3. 不要直接双击HTML文件打开必须通过 http://localhost:3000 访问
### 错误2: "端口被占用"
**原因**: 3000端口已被其他程序使用
**解决方法**:
1. 修改 server.js 中的端口号第189行
2.`const PORT = 3000;` 改为其他端口,如 `const PORT = 3001;`
3. 访问地址相应改为 http://localhost:3001
### 错误3: "node不是内部或外部命令"
**原因**: 未安装Node.js
**解决方法**:
1. 下载安装 Node.js: https://nodejs.org/
2. 安装后重启命令行
3. 验证安装: `node -v`
## 📝 使用流程
1. **启动服务器**`node server.js`
2. **打开后台** → http://localhost:3000/admin.html
3. **登录系统** → admin / admin123
4. **创建名单** → 输入名单名称和成员
5. **获取编号** → 系统生成编号和二维码
6. **用户点名** → 打开index.html输入编号
7. **完成点名** → 拍照或手动点名
## 🔧 技术说明
- **前端**: HTML + CSS + JavaScript
- **后端**: Node.js原生HTTP服务器
- **数据**: JSON文件存储
- **端口**: 默认3000
- **协议**: HTTP
## 💡 提示
- 服务器必须保持运行状态
- 关闭命令行窗口会停止服务器
- 数据保存在 data_lists.json 和 data_records.json
- 清除浏览器缓存不会丢失数据