mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-02 22:02:13 +08:00
fix(config): return full URLs for backend and LangGraph base URLs (#1392)
This commit is contained in:
@@ -2,7 +2,10 @@ import { env } from "@/env";
|
||||
|
||||
export function getBackendBaseURL() {
|
||||
if (env.NEXT_PUBLIC_BACKEND_BASE_URL) {
|
||||
return env.NEXT_PUBLIC_BACKEND_BASE_URL;
|
||||
return new URL(
|
||||
env.NEXT_PUBLIC_BACKEND_BASE_URL,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
@@ -10,7 +13,10 @@ export function getBackendBaseURL() {
|
||||
|
||||
export function getLangGraphBaseURL(isMock?: boolean) {
|
||||
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
|
||||
return env.NEXT_PUBLIC_LANGGRAPH_BASE_URL;
|
||||
return new URL(
|
||||
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
} else if (isMock) {
|
||||
if (typeof window !== "undefined") {
|
||||
return `${window.location.origin}/mock/api`;
|
||||
|
||||
Reference in New Issue
Block a user