mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-24 14:44:46 +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() {
|
export function getBackendBaseURL() {
|
||||||
if (env.NEXT_PUBLIC_BACKEND_BASE_URL) {
|
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 {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -10,7 +13,10 @@ export function getBackendBaseURL() {
|
|||||||
|
|
||||||
export function getLangGraphBaseURL(isMock?: boolean) {
|
export function getLangGraphBaseURL(isMock?: boolean) {
|
||||||
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
|
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) {
|
} else if (isMock) {
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
return `${window.location.origin}/mock/api`;
|
return `${window.location.origin}/mock/api`;
|
||||||
|
|||||||
Reference in New Issue
Block a user