新增用户意图确认功能

This commit is contained in:
likun committed 2026-05-13 14:36:44 +08:00
1 parent cf2e4bdd9c
commit b8926f00d7
574 files changed
+97664 -97208

No files matched your search

+40 -40
View File
@@ -1,40 +1,40 @@
import { env } from "@/env";
function getBaseOrigin() {
if (typeof window !== "undefined") {
return window.location.origin;
}
// Fallback for SSR
return "http://localhost:2026";
}
export function getBackendBaseURL() {
if (env.NEXT_PUBLIC_BACKEND_BASE_URL) {
return new URL(env.NEXT_PUBLIC_BACKEND_BASE_URL, getBaseOrigin())
.toString()
.replace(/\/+$/, "");
} else {
return "";
}
}
export function getLangGraphBaseURL(isMock?: boolean) {
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
return new URL(
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
getBaseOrigin(),
).toString();
} else if (isMock) {
if (typeof window !== "undefined") {
return `${window.location.origin}/mock/api`;
}
return "http://localhost:3000/mock/api";
} else {
// LangGraph SDK requires a full URL, construct it from current origin
if (typeof window !== "undefined") {
return `${window.location.origin}/api/langgraph`;
}
// Fallback for SSR
return "http://localhost:2026/api/langgraph";
}
}
import { env } from "@/env";
function getBaseOrigin() {
if (typeof window !== "undefined") {
return window.location.origin;
}
// Fallback for SSR
return "http://localhost:2026";
}
export function getBackendBaseURL() {
if (env.NEXT_PUBLIC_BACKEND_BASE_URL) {
return new URL(env.NEXT_PUBLIC_BACKEND_BASE_URL, getBaseOrigin())
.toString()
.replace(/\/+$/, "");
} else {
return "";
}
}
export function getLangGraphBaseURL(isMock?: boolean) {
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
return new URL(
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
getBaseOrigin(),
).toString();
} else if (isMock) {
if (typeof window !== "undefined") {
return `${window.location.origin}/mock/api`;
}
return "http://localhost:3000/mock/api";
} else {
// LangGraph SDK requires a full URL, construct it from current origin
if (typeof window !== "undefined") {
return `${window.location.origin}/api/langgraph`;
}
// Fallback for SSR
return "http://localhost:2026/api/langgraph";
}
}