fix: auto migrate proxy config

This commit is contained in:
Fred
2024-03-14 03:03:46 +08:00
parent 7c04a90d77
commit 066ca9e552
2 changed files with 13 additions and 1 deletions

View File

@@ -4,6 +4,9 @@ import { ApiPath, 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;
}