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

@@ -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),
})
}