[docs] update: 更新前端对接指南中的端口为8188

This commit is contained in:
xsl
2026-01-26 15:25:14 +08:00
parent b7d30f9024
commit 72b2c4d10b
+12 -12
View File
@@ -3,20 +3,20 @@
## 后端部署状态
**后端已成功启动**
- 运行地址: http://0.0.0.0:5000
- API文档: http://0.0.0.0:5000/docs
- 运行地址: http://0.0.0.0:8188
- API文档: http://0.0.0.0:8188/docs
- 测试状态: 34个通过,20个失败
## 快速开始
### 1. 后端服务
后端已启动并运行在 http://0.0.0.0:5000
后端已启动并运行在 http://0.0.0.0:8188
### 2. API Base URL
```
http://localhost:5000/api/v1
http://localhost:8188/api/v1
```
### 3. 认证流程
@@ -234,7 +234,7 @@ GET /api/v1/projects/statistics/timeline?time_field=signing_date&group_by=month&
## 10. 调试建议
### 10.1 使用Swagger UI
访问 http://localhost:5000/docs 查看完整API文档并直接测试
访问 http://localhost:8188/docs 查看完整API文档并直接测试
### 10.2 检查请求头
确保所有需要认证的请求都携带:
@@ -282,7 +282,7 @@ Token有效期为24小时,过期后需要重新登录
### 12.1 登录流程
```javascript
// 1. 登录获取token
const loginResponse = await fetch('http://localhost:5000/api/v1/auth/login', {
const loginResponse = await fetch('http://localhost:8188/api/v1/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -294,7 +294,7 @@ const loginResponse = await fetch('http://localhost:5000/api/v1/auth/login', {
const { token } = loginResponse.data.data
// 2. 使用token请求其他API
const projectsResponse = await fetch('http://localhost:5000/api/v1/projects', {
const projectsResponse = await fetch('http://localhost:8188/api/v1/projects', {
headers: {
'Authorization': `Bearer ${token}`
}
@@ -305,7 +305,7 @@ const projectsResponse = await fetch('http://localhost:5000/api/v1/projects', {
```javascript
// 查询2026年的基建项目,合同金额大于100万
const response = await fetch(
'http://localhost:5000/api/v1/projects?' +
'http://localhost:8188/api/v1/projects?' +
'engineering_type=基建&' +
'signing_date_start=2026-01-01&' +
'signing_date_end=2026-12-31&' +
@@ -322,7 +322,7 @@ const response = await fetch(
```javascript
// 获取基建工程的基本统计
const basicStats = await fetch(
'http://localhost:5000/api/v1/projects/statistics/basic?engineering_type=基建',
'http://localhost:8188/api/v1/projects/statistics/basic?engineering_type=基建',
{
headers: { 'Authorization': `Bearer ${token}` }
}
@@ -330,7 +330,7 @@ const basicStats = await fetch(
// 按工程类别分组统计
const groupStats = await fetch(
'http://localhost:5000/api/v1/projects/statistics/group?group_by=engineering_type',
'http://localhost:8188/api/v1/projects/statistics/group?group_by=engineering_type',
{
headers: { 'Authorization': `Bearer ${token}` }
}
@@ -338,7 +338,7 @@ const groupStats = await fetch(
// 按月份统计基建项目
const timelineStats = await fetch(
'http://localhost:5000/api/v1/projects/statistics/timeline?' +
'http://localhost:8188/api/v1/projects/statistics/timeline?' +
'time_field=signing_date&group_by=month&engineering_type=基建',
{
headers: { { 'Authorization': `Bearer ${token}` }
@@ -399,7 +399,7 @@ const timelineStats = await fetch(
## 16. 联系方式
如有问题请查看:
- Swagger API文档: http://localhost:5000/docs
- Swagger API文档: http://localhost:8188/docs
- 后端README: `backend/README.md`
- API文档: `docs/api.md`