- 新增项目文档和 Docker 配置 - 添加 README.md 和 TODO.md 项目文档 - 为各服务添加 Dockerfile 和 docker-compose 配置 - 重构后端架构 - 新增 adapter 层(HTTP/Python 适配器) - 新增 repository 层(数据访问抽象) - 新增 router 模块统一管理路由 - 新增账单处理 handler - 扩展前端 UI 组件库 - 新增 Calendar、DateRangePicker、Drawer、Popover 等组件 - 集成 shadcn-svelte 组件库 - 增强分析页面功能 - 添加时间范围筛选器(支持本月默认值) - 修复 DateRangePicker 默认值显示问题 - 优化数据获取和展示逻辑 - 完善分析器服务 - 新增 FastAPI 服务接口 - 改进账单清理器实现
20 lines
605 B
TypeScript
20 lines
605 B
TypeScript
import { env } from '$env/dynamic/private';
|
|
import type { RequestHandler } from './$types';
|
|
|
|
// 服务端使用 Docker 内部地址
|
|
const API_URL = env.API_URL || 'http://localhost:8080';
|
|
|
|
export const GET: RequestHandler = async ({ params, fetch }) => {
|
|
const path = params.path;
|
|
|
|
const response = await fetch(`${API_URL}/download/${path}`);
|
|
|
|
return new Response(response.body, {
|
|
status: response.status,
|
|
headers: {
|
|
'Content-Type': response.headers.get('Content-Type') || 'text/csv',
|
|
'Content-Disposition': response.headers.get('Content-Disposition') || '',
|
|
},
|
|
});
|
|
};
|