修复前端api漏掉/api路径问题
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
@@ -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',
|
||||
})
|
||||
}
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ type CreateResourceParams = {
|
||||
}
|
||||
|
||||
export async function create(data: CreateResourceParams) {
|
||||
return fetcher('/admin/web/resource', {
|
||||
return fetcher('/api/admin/web/resource', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
|
||||
@@ -2,5 +2,5 @@ import fetcher from "@/lib/api/fetcher";
|
||||
import { Resource } from "@/lib/types/resource";
|
||||
|
||||
export async function list() {
|
||||
return fetcher<Resource[]>('/admin/web/resource')
|
||||
return fetcher<Resource[]>('/api/admin/web/resource')
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import fetcher from "@/lib/api/fetcher";
|
||||
|
||||
export async function remove(id: string) {
|
||||
return fetcher(`/admin/web/resource/${id}`, {
|
||||
return fetcher(`/api/admin/web/resource/${id}`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
@@ -12,7 +12,7 @@ type UpdateResourceParams = {
|
||||
}
|
||||
|
||||
export async function update(id: string, data: UpdateResourceParams) {
|
||||
return fetcher(`/admin/web/resource/${id}`, {
|
||||
return fetcher(`/api/admin/web/resource/${id}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user