remove DEFAULT_API_HOST

This commit is contained in:
lloydzhou
2024-09-30 01:19:20 +08:00
parent 5141145e4d
commit a50c282d01
13 changed files with 45 additions and 90 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}`;
}