feat: 重构前端api封装结构

This commit is contained in:
2025-12-16 22:51:27 +08:00
parent 0018b50914
commit 5ce34c4c95
46 changed files with 211 additions and 441 deletions

View File

@@ -0,0 +1,19 @@
import { serverFetch } from "../server";
export type ResourceTagType = {
name: string;
type: string;
}
export interface Resource {
id: string;
title: string;
description: string;
imageUrl: string;
link: string;
tags: ResourceTagType[];
}
export async function list() {
return serverFetch<Resource[]>('/api/resource')
}