From 8c18cc2b7846d098fa6ee1681c39c45755f86fb8 Mon Sep 17 00:00:00 2001 From: zhangheng Date: Wed, 8 Apr 2026 16:49:30 +0800 Subject: [PATCH] fix(env): sam2 --- components/label/api/label/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/label/api/label/index.ts b/components/label/api/label/index.ts index 72775e7..47179ec 100644 --- a/components/label/api/label/index.ts +++ b/components/label/api/label/index.ts @@ -120,6 +120,13 @@ export const getAuxiliaryAnnotation = (data: any) => { }) } +const BASE_SAM_API = + process.env.NEXT_PUBLIC_ENV === "production" + ? "http://172.16.103.224:9120" + : process.env.NEXT_PUBLIC_ENV === "staging" + ? "http://172.30.21.211:8000" + : "http://172.30.21.211:8000" + export const getAuxiliaryAnnotation2 = (data: { project_id: number image_name: string @@ -133,7 +140,7 @@ export const getAuxiliaryAnnotation2 = (data: { contours: Array> hollows: Array }>({ - url: "http://172.30.21.211:8000/api/sam2/image_predictor", + url: BASE_SAM_API + "/api/sam2/image_predictor", method: "POST", body: JSON.stringify(data), })