修复WebUI api 请求地址,更新docker 部署

This commit is contained in:
TOM88812
2025-02-15 22:36:01 +08:00
parent e7645198ba
commit 5b6899052a
13 changed files with 93 additions and 33 deletions
+16
View File
@@ -0,0 +1,16 @@
// 获取当前运行环境的基础 URL
const getBaseUrl = () => {
// 如果是开发环境,使用环境变量中的地址
if (import.meta.env.DEV) {
return import.meta.env.VITE_API_BASE_URL;
}
// 生产环境使用当前域名和端口
const protocol = window.location.protocol;
const hostname = window.location.hostname;
const port = window.location.port;
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
};
export const API_BASE_URL = getBaseUrl();