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..3fed152ef 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 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() {