1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# VITE_API_BASE=http://192.168.120.17:8000
|
||||
#VITE_API_BASE=https://apiforeign.minzhong.cn
|
||||
VITE_API_BASE=http://ceshi.apiforeign.minzhongzc.com
|
||||
VITE_API_BASE=https://ceshi.apiforeign.minzhongzc.com
|
||||
VITE_USE_MOCK=false
|
||||
# Encryption disabled for dev — enable in production
|
||||
VITE_ENCRYPTION_KEY=
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-DBKUBJv5.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-MWrMIMSc.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -129,7 +129,7 @@ class Settings(BaseSettings):
|
||||
|
||||
CAPTCHA_ENABLED: bool = True
|
||||
|
||||
BASE_URL: str = "http://ceshi.apiforeign.minzhongzc.com"
|
||||
BASE_URL: str = "https://ceshi.apiforeign.minzhongzc.com"
|
||||
|
||||
CORS_ORIGINS: list[str] = ["*"]
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import base64
|
||||
import json
|
||||
import mimetypes
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
@@ -292,22 +290,15 @@ async def _call_openai_compatible(
|
||||
|
||||
def _file_url_or_data_uri(file_url: str, fallback_mime: str) -> str:
|
||||
"""
|
||||
Convert local upload path to base64 data URI.
|
||||
Keep remote http/https/data URLs as-is.
|
||||
远程 URL 保持原样;本地上传路径拼接 BASE_URL 转为完整链接。
|
||||
"""
|
||||
if file_url.startswith(("http://", "https://", "data:")):
|
||||
return file_url
|
||||
|
||||
# Compatible with /uploads/xxx and plain relative paths
|
||||
relative_path = file_url.replace("/uploads/", "", 1).lstrip("/")
|
||||
file_path = os.path.join(settings.UPLOAD_LOCAL_PATH, relative_path)
|
||||
|
||||
mime = mimetypes.guess_type(file_path)[0] or fallback_mime
|
||||
|
||||
with open(file_path, "rb") as f:
|
||||
b64 = base64.b64encode(f.read()).decode()
|
||||
|
||||
return f"data:{mime};base64,{b64}"
|
||||
# 本地上传路径拼接 BASE_URL,例如 /uploads/images/xxx.png → https://domain.com/uploads/images/xxx.png
|
||||
base = settings.BASE_URL.rstrip("/")
|
||||
path = file_url if file_url.startswith("/") else f"/{file_url}"
|
||||
return f"{base}{path}"
|
||||
|
||||
if image_urls or video_urls:
|
||||
user_message, log_user_message = await _build_multimodal_content(
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
|
||||
# VITE_API_BASE=http://192.168.120.17:8000
|
||||
#VITE_API_BASE=https://apiforeign.minzhong.cn
|
||||
VITE_API_BASE=http://ceshi.apiforeign.minzhongzc.com
|
||||
#VITE_API_BASE=https://apiforeign.minzhongzc.com
|
||||
VITE_API_BASE=https://ceshi.apiforeign.minzhongzc.com
|
||||
VITE_USE_MOCK=false
|
||||
# Encryption disabled for dev — enable in production
|
||||
VITE_ENCRYPTION_KEY=
|
||||
|
||||
+9
-9
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-BpUgZBmn.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-mLPAhw5a.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Bsz_Xon-.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user