73 lines
1.6 KiB
Markdown
73 lines
1.6 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错误 | 重启后端服务 |
|
||
|
||
### 7. 用户协议页面检查
|
||
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
确认返回HTML内容
|
||
|
||
### 8. 前端静态文件检查
|
||
|
||
确认用户协议文件存在
|