修复前端api漏掉/api路径问题

This commit is contained in:
2025-05-12 16:01:37 +08:00
parent 8e0d7dc873
commit 2a1e0d45dd
8 changed files with 8 additions and 8 deletions

View File

@@ -5,7 +5,7 @@ type CreateBlogParams = {
}
export async function create(data: CreateBlogParams) {
return fetcher('/admin/web/blog', {
return fetcher('/api/admin/web/blog', {
method: 'POST',
body: JSON.stringify(data)
})

View File

@@ -1,5 +1,5 @@
import fetcher from "@/lib/api/fetcher";
export async function list() {
return fetcher('/admin/web/blog')
return fetcher('/api/admin/web/blog')
}

View File

@@ -1,7 +1,7 @@
import fetcher from "@/lib/api/fetcher";
export async function remove(id: string) {
return fetcher(`/admin/web/blog/${id}`, {
return fetcher(`/api/admin/web/blog/${id}`, {
method: 'DELETE',
})
}

View File

@@ -5,7 +5,7 @@ type UpdateBlogParams = {
}
export async function update(id: string, data: UpdateBlogParams) {
return fetcher(`/admin/web/blog/${id}`, {
return fetcher(`/api/admin/web/blog/${id}`, {
method: 'POST',
body: JSON.stringify(data)
})