haha
This commit is contained in:
@@ -123,7 +123,7 @@ GET /api/contacts/export?search=产品经理&start_date=2024-01-01&end_date=2024
|
||||
"code": 200,
|
||||
"msg": "success",
|
||||
"data": {
|
||||
"download_url": "/media/exports/contacts_export_20240304_153045_a1b2c3d4.xlsx",
|
||||
"download_url": "http://127.0.0.1:8000/media/exports/contacts_export_20240304_153045_a1b2c3d4.xlsx",
|
||||
"filename": "contacts_export_20240304_153045_a1b2c3d4.xlsx",
|
||||
"total_records": 150,
|
||||
"generated_at": "2024-03-04 15:30:45"
|
||||
@@ -135,7 +135,7 @@ GET /api/contacts/export?search=产品经理&start_date=2024-01-01&end_date=2024
|
||||
|
||||
| 字段名 | 类型 | 说明 |
|
||||
|--------|------|------|
|
||||
| download_url | string | 文件下载链接(相对路径) |
|
||||
| download_url | string | 文件下载链接(完整 URL) |
|
||||
| filename | string | 生成的文件名 |
|
||||
| total_records | integer | 导出的记录总数 |
|
||||
| generated_at | string | 文件生成时间 |
|
||||
@@ -313,6 +313,5 @@ const handleExport = async () => {
|
||||
- token 格式:`Bearer <token>`
|
||||
|
||||
6. **下载链接**:
|
||||
- 返回的 `download_url` 是相对路径
|
||||
- 前端需要拼接完整的服务器地址(如果跨域)
|
||||
- 或直接使用相对路径(如果同域)
|
||||
- 返回的 `download_url` 是可直接访问的完整下载 URL
|
||||
- 前端可直接 `window.open(download_url)` 或 `a.href = download_url` 下载
|
||||
|
||||
Reference in New Issue
Block a user