feat: 添加基础API请求与工具函数模块

This commit is contained in:
FalingCliff 2025-06-15 00:33:50 +08:00
parent 2b885dc351
commit 87c0e1e130
2 changed files with 11 additions and 0 deletions

6
src/api/index.ts Normal file
View File

@ -0,0 +1,6 @@
// API 请求封装
export const fetchData = async (url: string) => {
const response = await fetch(url);
return response.json();
};

5
src/utils/index.ts Normal file
View File

@ -0,0 +1,5 @@
// 工具函数集合
export const formatDate = (date: Date) => {
return date.toISOString().split('T')[0];
};