feat: 添加基础API请求与工具函数模块
This commit is contained in:
parent
2b885dc351
commit
87c0e1e130
|
|
@ -0,0 +1,6 @@
|
|||
// API 请求封装
|
||||
export const fetchData = async (url: string) => {
|
||||
const response = await fetch(url);
|
||||
return response.json();
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
// 工具函数集合
|
||||
export const formatDate = (date: Date) => {
|
||||
return date.toISOString().split('T')[0];
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue