修改配置

This commit is contained in:
vet
2026-04-13 23:28:06 +07:00
parent fc351cf730
commit d6572d2217
6 changed files with 200 additions and 3 deletions

View File

@@ -225,3 +225,25 @@ print_svc_status() {
# ── 所有后端服务名列表 ──────────────────────────────────────────────────────────
ALL_SVCS=(openim-server chat-rpc admin-rpc chat-api admin-api meetingmsg livecloud livestream build-server)
# ── PC 前端 Vite 环境(不写 pc 目录,由 07-start-frontend 在子 shell 内 export────────
# 依赖 .env.deploy-test / .env.deploy-local 中的 PC_BACKEND_ORIGIN及可选 PC_VITE_*
pc_export_vite_backend_env() {
local o="${PC_BACKEND_ORIGIN:-}"
o="${o%/}"
[[ -z "$o" ]] && return 0
local host
host=$(printf '%s' "$o" | sed -E 's#^https?://([^/]+).*#\1#')
[[ -z "$host" ]] && return 0
export VITE_BASE_DOMAIN="${PC_VITE_BASE_DOMAIN:-$host}"
export VITE_API_URL="${PC_VITE_API_URL:-$o/api/im}"
export VITE_CHAT_URL="${PC_VITE_CHAT_URL:-$o/api/chat}"
export VITE_USER_URL="${PC_VITE_USER_URL:-$o/api/user}"
if [[ "$o" == http://* ]]; then
export VITE_WS_URL="${PC_VITE_WS_URL:-ws://${host}/msg_gateway}"
else
export VITE_WS_URL="${PC_VITE_WS_URL:-wss://${host}/msg_gateway}"
fi
}