From cd9662c17e762f1d4782c72678f07700cb9b15f0 Mon Sep 17 00:00:00 2001 From: gouzi <530971494@qq.com> Date: Sat, 27 Jul 2024 16:22:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix(page):=20ml=20baseUrl=20?= =?UTF-8?q?error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Classification/index.tsx | 2 +- src/pages/Detection/index.tsx | 4 ++-- src/pages/Ocr/index.tsx | 2 +- src/services/utils.ts | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages/Classification/index.tsx b/src/pages/Classification/index.tsx index 6efe8b4aa..2e6c6801d 100644 --- a/src/pages/Classification/index.tsx +++ b/src/pages/Classification/index.tsx @@ -18,7 +18,7 @@ import useImage from 'use-image'; import PPSetButton from '@/components/PPLabelPage/PPButtonSet'; const port = window.location.port == '8000' ? '1234' : window.location.port; -const baseUrl = `http://${window.location.hostname}:${port}/`; +const baseUrl = `http://${window.location.hostname}:${port}`; const Page: React.FC = () => { const page = useRef(null); const intl = IntlInit('pages.classification'); diff --git a/src/pages/Detection/index.tsx b/src/pages/Detection/index.tsx index f4a33b04e..67862b3f8 100644 --- a/src/pages/Detection/index.tsx +++ b/src/pages/Detection/index.tsx @@ -21,7 +21,7 @@ import { IntlInitJsx } from '@/components/PPIntl'; import PPSetButton from '@/components/PPLabelPage/PPButtonSet'; import Keyevent from 'react-keyevent'; const port = window.location.port == '8000' ? '1234' : window.location.port; -const baseUrl = `http://${window.location.hostname}:${port}/`; +const baseUrl = `http://${window.location.hostname}:${port}`; const Page = () => { // todo: change to use annotation // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -757,7 +757,7 @@ const Page = () => { { onPredicted(image); }} diff --git a/src/pages/Ocr/index.tsx b/src/pages/Ocr/index.tsx index a67c37852..431878f1f 100644 --- a/src/pages/Ocr/index.tsx +++ b/src/pages/Ocr/index.tsx @@ -24,7 +24,7 @@ import PPProgress from '@/components/PPLabelPage/PPProgress'; import { IntlInitJsx } from '@/components/PPIntl'; import PPSetButton from '@/components/PPLabelPage/PPButtonSet'; const port = window.location.port == '8000' ? '1234' : window.location.port; -const baseUrl = `http://${window.location.hostname}:${port}/`; +const baseUrl = `http://${window.location.hostname}:${port}`; export type DrawToolType = { polygon: PPDrawToolRet; brush: undefined; diff --git a/src/services/utils.ts b/src/services/utils.ts index 8f7f0d7fe..8fa8036b7 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -21,7 +21,6 @@ import { IntlInitJsx } from '@/components/PPIntl'; import type { ToolType, Annotation, Label } from '@/models/'; import { ModelApi } from '@/services/ml'; import type { Model } from '@/services/ml/models'; -import { History } from '/Users/v_xiaoyixin/paddlefortends/PaddleLabel-Frontend/node_modules/@umijs/runtime'; const baseUrl = localStorage.getItem('basePath'); const config = new Configuration(baseUrl ? { basePath: baseUrl } : undefined); @@ -905,7 +904,6 @@ export function ModelUtils(useState: UseStateType, mlBackendUrl: string = undefi const [backendUrl, setBackendUrl] = useState(mlBackendUrl); const [loading, setLoading] = useState(false); const intl = IntlInit('component.PPInteractorModal'); - // let modelApi = new ModelApi(new Configuration({ basePath: backendUrl })); let modelApi = new ModelApi(new Configuration({ basePath: backendUrl })); async function getAll() { From f827a059468004c72e269e351f2c65233e2d1fd1 Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:31:53 +0800 Subject: [PATCH 2/2] Update src/pages/Detection/index.tsx --- src/pages/Detection/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Detection/index.tsx b/src/pages/Detection/index.tsx index 67862b3f8..3fed152ef 100644 --- a/src/pages/Detection/index.tsx +++ b/src/pages/Detection/index.tsx @@ -757,7 +757,7 @@ const Page = () => { { onPredicted(image); }}