From 87c0e1e130eb6c442ef8060297717e1854349d60 Mon Sep 17 00:00:00 2001 From: FalingCliff Date: Sun, 15 Jun 2025 00:33:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9F=BA=E7=A1=80API?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E4=B8=8E=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 6 ++++++ src/utils/index.ts | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 src/api/index.ts create mode 100644 src/utils/index.ts diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 0000000..09c7dc9 --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1,6 @@ +// API 请求封装 +export const fetchData = async (url: string) => { + const response = await fetch(url); + return response.json(); +}; + diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..6d57474 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,5 @@ +// 工具函数集合 +export const formatDate = (date: Date) => { + return date.toISOString().split('T')[0]; +}; +