61 lines
1.3 KiB
Markdown
61 lines
1.3 KiB
Markdown
|
|
# 部署检查清单
|
|||
|
|
|
|||
|
|
## 部署后必须检查
|
|||
|
|
|
|||
|
|
### 1. 环境变量检查
|
|||
|
|
```bash
|
|||
|
|
cat backend/.env
|
|||
|
|
```
|
|||
|
|
必须包含:
|
|||
|
|
- ✅ DASHSCOPE_API_KEY(不是sk-xxx)
|
|||
|
|
- ✅ SMS_ACCESS_KEY_ID
|
|||
|
|
- ✅ SMS_SIGN_NAME
|
|||
|
|
- ✅ SMS_TEMPLATE_CODE
|
|||
|
|
|
|||
|
|
### 2. 代码版本检查
|
|||
|
|
```bash
|
|||
|
|
git log --oneline -1
|
|||
|
|
```
|
|||
|
|
确认是目标版本
|
|||
|
|
|
|||
|
|
### 3. OCR扩展名检查
|
|||
|
|
```bash
|
|||
|
|
grep temp_extensions backend/app/routers/ocr.py
|
|||
|
|
```
|
|||
|
|
确认包含大小写扩展名 JPG JPEG PNG GIF
|
|||
|
|
|
|||
|
|
### 4. Python版本检查
|
|||
|
|
```bash
|
|||
|
|
python3 --version
|
|||
|
|
```
|
|||
|
|
必须是 3.11+
|
|||
|
|
|
|||
|
|
### 5. 服务启动检查
|
|||
|
|
```bash
|
|||
|
|
curl http://localhost:3000/
|
|||
|
|
```
|
|||
|
|
返回 200
|
|||
|
|
|
|||
|
|
### 6. API测试
|
|||
|
|
```bash
|
|||
|
|
# 登录
|
|||
|
|
TOKEN=$(curl -s -X POST http://localhost:3000/api/auth/login \
|
|||
|
|
-H "Content-Type: application/x-www-form-urlencoded" \
|
|||
|
|
-d "username=admin&password=admin123" | python3 -c "import sys,json; print(json.load(sys.stdin).get(access_token,))")
|
|||
|
|
|
|||
|
|
# 测试验证码
|
|||
|
|
curl -X POST http://localhost:3000/api/auth/send-verification-code \
|
|||
|
|
-H "Authorization: Bearer $TOKEN" \
|
|||
|
|
-H "Content-Type: application/json" \
|
|||
|
|
-d '{"phone":"13800138000"}'
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 常见问题快速修复
|
|||
|
|
|
|||
|
|
| 问题 | 修复命令 |
|
|||
|
|
|------|---------|
|
|||
|
|
| OCR慢 | 检查DASHSCOPE_API_KEY是否正确 |
|
|||
|
|
| 验证码失败 | 检查SMS_*配置是否完整 |
|
|||
|
|
| 导入错误 | 使用python3.11启动 |
|
|||
|
|
| 404错误 | 重启后端服务 |
|