This commit is contained in:
2025-10-22 17:26:10 +08:00
parent 476944d22e
commit 3bc3fb7d02
10 changed files with 864 additions and 687 deletions

View File

@@ -31,7 +31,10 @@ async function request<T>(url: string, options: RequestInit = {}): Promise<T> {
// API方法
export const api = {
// 获取项目列表
getProjects: (): Promise<Project[]> => request<Project[]>("/projects"),
getProjects: (searchQuery?: string): Promise<Project[]> => {
const url = searchQuery ? `/projects?search=${encodeURIComponent(searchQuery)}` : "/projects"
return request<Project[]>(url)
},
// 上传项目
uploadProject: (formData: FormData): Promise<UploadResponse> => {