remove DEFAULT_API_HOST

This commit is contained in:
lloydzhou
2024-09-25 20:46:01 +08:00
parent cc33b7b6bf
commit 540f93ad25
11 changed files with 20 additions and 115 deletions

View File

@@ -1,19 +0,0 @@
import { getClientConfig } from "../config/client";
import { DEFAULT_API_HOST } from "../constant";
export function corsPath(path: string) {
const baseUrl = getClientConfig()?.isApp ? `${DEFAULT_API_HOST}` : "";
if (baseUrl === "" && path === "") {
return "";
}
if (!path.startsWith("/")) {
path = "/" + path;
}
if (!path.endsWith("/")) {
path += "/";
}
return `${baseUrl}${path}`;
}