fix(api): method fix

This commit is contained in:
2026-02-09 18:23:40 +08:00
parent 3f284d057c
commit 0fea0de600
5 changed files with 44 additions and 44 deletions

View File

@@ -6,7 +6,7 @@ import { Daily } from "./typing"
export const getDailyWorkList = (data: Daily.Request) => {
return httpFetch<Daily.Response>({
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -18,7 +18,7 @@ export const getDailyWorkList = (data: Daily.Request) => {
export const addDailyWorkData = (data: Daily.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/add",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,

View File

@@ -1,11 +1,11 @@
import httpFetch from "@/api/fetch"
import { usePermissionStore } from "../../store/auth"
import {
LabelResult,
LoginInfo,
RequestLabelResult,
ServerResponse,
} from "./typing"
import { usePermissionStore } from "../../store/auth"
export const BASE_LABEL_API = "https://label.cowarobot.com"
@@ -18,7 +18,7 @@ export const getLabelResult = (task_id: number) => {
url:
BASE_LABEL_API +
`/api/v1/label_server/task/label_result?task_id=${task_id}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -29,7 +29,7 @@ export const getLabelResult = (task_id: number) => {
export const saveLabelResult = (data: RequestLabelResult) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/task/label_result",
method: "post",
method: "POST",
body: JSON.stringify(data),
})
}
@@ -46,7 +46,7 @@ export const getServerImage = async (data: {
return new Promise((resolve, reject) => {
httpFetch<ServerResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/data/list",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -70,7 +70,7 @@ export const getServerImage = async (data: {
try {
const res = await httpFetch<ServerResponse>({
url: `/http://${proxy}:9112/api/v1/label_sync/get_data_list`,
method: "post",
method: "POST",
body: JSON.stringify(params),
})
return res.data.data_list?.[0].image_data || ""
@@ -78,7 +78,7 @@ export const getServerImage = async (data: {
console.log(error)
const res = await httpFetch<ServerResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/data/list",
method: "post",
method: "POST",
body: JSON.stringify({ ...params, flag: 1 }),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -98,7 +98,7 @@ export const getLabelImage = (activeImage: string, path: string) => {
`/api/v1/label_server/data/image?data_name=${encodeURIComponent(
activeImage
)}&project_path=${encodeURIComponent(path)}`,
method: "get",
method: "GET",
headerAttr: {
responseType: "blob",
},
@@ -109,7 +109,7 @@ export const getLabelImage = (activeImage: string, path: string) => {
export const getAuxiliaryAnnotation = (data: any) => {
return httpFetch<any>({
url: BASE_LABEL_API + "/api/model_server/sam2/sa",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
responseType: "arraybuffer",
@@ -121,7 +121,7 @@ export const getAuxiliaryAnnotation = (data: any) => {
export const getTrackingAuxiliaryAnnotation = (data: any) => {
return httpFetch<any>({
url: BASE_LABEL_API + "/api/model_server/sam2/vos",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
responseType: "arraybuffer",
@@ -133,7 +133,7 @@ export const getTrackingAuxiliaryAnnotation = (data: any) => {
export const userLogin = (data: { name: string; password: string }) => {
return httpFetch<LoginInfo>({
url: BASE_LABEL_API + "/api/v1/label_server/user/login",
method: "post",
method: "POST",
body: JSON.stringify(data),
})
}

View File

@@ -7,7 +7,7 @@ import { Project, ProjectDetail, ReviewUsers } from "./typing"
export const getProjectList = (data: Project.ListRequest) => {
return httpFetch<Project.ListResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/project/list",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -20,7 +20,7 @@ export const getProjectList = (data: Project.ListRequest) => {
export const getProjectDetailById = (id: number) => {
return httpFetch<ProjectDetail.DataProps>({
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -32,7 +32,7 @@ export const getProjectDetailById = (id: number) => {
export const checkLabelDataSource = (data: Project.CheckRequest) => {
return httpFetch<Project.CheckResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/project/check_data",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -45,7 +45,7 @@ export const checkLabelDataSource = (data: Project.CheckRequest) => {
export const projectAdd = (data: Project.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/add",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -58,7 +58,7 @@ export const projectAdd = (data: Project.CreateProps) => {
export const projectReview = (data: Project.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/review",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -71,7 +71,7 @@ export const projectReview = (data: Project.CreateProps) => {
export const projectConfig = (data: Project.ConfigProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/config",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -84,7 +84,7 @@ export const projectConfig = (data: Project.ConfigProps) => {
export const projectEditById = (data: any, id: number) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/project/edit/${id}`,
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -97,7 +97,7 @@ export const projectEditById = (data: any, id: number) => {
export const projectPreLabelReview = (data: Project.PreLabelProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/prototype_review",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -110,7 +110,7 @@ export const projectPreLabelReview = (data: Project.PreLabelProps) => {
export const projectDeliver = (data: { project_id: number }) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/deliver",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -123,7 +123,7 @@ export const projectDeliver = (data: { project_id: number }) => {
export const projectAccept = (data: { project_id: number; pass: boolean }) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/accept",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -139,7 +139,7 @@ export const projectCollect = (data: {
}) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/project/collect",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -152,7 +152,7 @@ export const projectCollect = (data: {
export const getReviewScaleList = (params: { project_id: number }) => {
return httpFetch<any[]>({
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/list",
method: "get",
method: "GET",
data: params,
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -165,7 +165,7 @@ export const getReviewScaleList = (params: { project_id: number }) => {
export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/save",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -177,7 +177,7 @@ export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
export const getProjectDetail = (id: number) => {
return httpFetch<Project.DetailResponse>({
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -189,7 +189,7 @@ export const getProjectDetail = (id: number) => {
export const regenerateProjectEmbedding = (data: { project_id: number }) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/project/regenerate_embedding`,
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -203,7 +203,7 @@ export const getPersonProjectDashBoard = () => {
return httpFetch<Array<Project.PersonProjectDashboardResponseItem>>({
url:
BASE_LABEL_API + `/api/v1/label_server/data_statistics/personal_project`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -238,7 +238,7 @@ export const getCurrentPersonData = (params: { date: string }) => {
export const getProjectTypeList = () => {
return httpFetch<string[]>({
url: BASE_LABEL_API + "/api/v1/label_server/project/type_list",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -250,7 +250,7 @@ export const getProjectTypeList = () => {
export const getProjectAdminList = () => {
return httpFetch<Array<{ label: string; value: number }>>({
url: BASE_LABEL_API + "/api/v1/label_server/project/admin_list",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -262,7 +262,7 @@ export const getProjectAdminList = () => {
export const getProjectReviewers = () => {
return httpFetch<ReviewUsers>({
url: BASE_LABEL_API + "/api/v1/label_server/project/reviewer_map",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -274,7 +274,7 @@ export const getProjectReviewers = () => {
export const getSelfProjectList = () => {
return httpFetch<Array<{ label: string; value: number }>>({
url: BASE_LABEL_API + "/api/v1/label_server/project/self",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,

View File

@@ -7,7 +7,7 @@ import { Scheme } from "./typing"
export const getLabelSchemeList = (params: Scheme.ListRequest) => {
return httpFetch<Scheme.ListResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/label_schema/list",
method: "get",
method: "GET",
data: params,
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -20,7 +20,7 @@ export const getLabelSchemeList = (params: Scheme.ListRequest) => {
export const addNewPlan = (data: Scheme.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/label_schema/add",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -35,7 +35,7 @@ export const getAllVersionByName = (name: string) => {
url:
BASE_LABEL_API +
`/api/v1/label_server/label_schema/version/list?name=${name}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
@@ -62,7 +62,7 @@ export const saveWrongWordList = (data: {
}) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/error_repository/save",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -77,7 +77,7 @@ export const getWrongWordList = () => {
data: { error: string; correct: string }[]
}>({
url: BASE_LABEL_API + "/api/v1/label_server/error_repository/query",
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,

View File

@@ -7,7 +7,7 @@ import { Task } from "./typing"
export const getTaskList = (data: Task.ListRequest) => {
return httpFetch<Task.ListResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/task/list",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -20,7 +20,7 @@ export const getTaskList = (data: Task.ListRequest) => {
export const taskAcquire = (data: Task.AcquireReqProps) => {
return httpFetch<Task.ListResponse>({
url: BASE_LABEL_API + "/api/v1/label_server/task/acquire",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -33,7 +33,7 @@ export const taskAcquire = (data: Task.AcquireReqProps) => {
export const taskDispatch = (data: Task.DispatchReqProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/task/dispatch",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -46,7 +46,7 @@ export const taskDispatch = (data: Task.DispatchReqProps) => {
export const taskRelease = (data: Task.ReleaseReqProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/task/release",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -59,7 +59,7 @@ export const taskRelease = (data: Task.ReleaseReqProps) => {
export const getNextTaskId = (data: Task.NextReqProps) => {
return httpFetch<Task.NextResProps>({
url: BASE_LABEL_API + "/api/v1/label_server/task/next",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -72,7 +72,7 @@ export const getNextTaskId = (data: Task.NextReqProps) => {
export const taskCommit = (data: Task.CommitReqProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/task/commit",
method: "post",
method: "POST",
body: JSON.stringify(data),
headerAttr: {
["Token"]: usePermissionStore.getState().token,
@@ -85,7 +85,7 @@ export const taskCommit = (data: Task.CommitReqProps) => {
export const getTaskWorkFlow = (id: number) => {
return httpFetch<any[]>({
url: BASE_LABEL_API + `/api/v1/label_server/task/workflow/${id}`,
method: "get",
method: "GET",
headerAttr: {
["Token"]: usePermissionStore.getState().token,
["Refresh-Token"]: usePermissionStore.getState().refresh_token,