From 1b94afd90b9f4cf640347b6953ab706448a26dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=94=9F=E4=BA=A7?= Date: Wed, 18 Mar 2026 11:03:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DLogo=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=B9=B6=E6=9B=B4=E6=96=B0=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/main.py | 3 +++ frontend/package-lock.json | 4 ++-- scripts/deploy.sh | 14 +++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index 60d634d..3dc746d 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -1,6 +1,9 @@ # FastAPI 应用入口 import os from pathlib import Path +from dotenv import load_dotenv +load_dotenv() + from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 40bcf2c..98bd8cb 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "jiachenlong-frontend", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jiachenlong-frontend", - "version": "1.0.0", + "version": "1.0.1", "dependencies": { "axios": "^1.7.9", "react": "^18.3.1", diff --git a/scripts/deploy.sh b/scripts/deploy.sh index c2ad0b6..8746f3e 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -88,16 +88,20 @@ elif [ "$ENV" == "test" ]; then log_info "测试环境部署完成:http://120.26.133.10/" elif [ "$ENV" == "production" ]; then - # 生产服务器 - SERVER="root@8.149.137.26" - DEST_DIR="/var/www/html" + # 生产服务器 A (WebA: 8.154.46.3) + SERVER="root@8.154.46.3" + DEPLOY_DIR="/var/www/frontend" # 部署前端构建文件 cd "$PROJECT_ROOT/frontend/dist" - tar -czf - . | ssh -o StrictHostKeyChecking=no "$SERVER" "cd $DEST_DIR && rm -rf * && tar -xzf -" + tar -czf - . | ssh -o StrictHostKeyChecking=no "$SERVER" "cd $DEPLOY_DIR && rm -rf * && tar -xzf -" # 部署静态资源(包含 Logo) - ssh -o StrictHostKeyChecking=no "$SERVER" "mkdir -p $DEST_DIR/static/images" + ssh -o StrictHostKeyChecking=no "$SERVER" "mkdir -p $DEPLOY_DIR/static/images" + scp -o StrictHostKeyChecking=no "$PROJECT_ROOT/static/images/jiachenlong-logo.png" "$SERVER:$DEPLOY_DIR/static/images/" + + ssh -o StrictHostKeyChecking=no "$SERVER" "nginx -s reload" + log_info "生产环境A部署完成:http://8.154.46.3/" scp -o StrictHostKeyChecking=no "$PROJECT_ROOT/static/images/jiachenlong-logo.png" "$SERVER:$DEST_DIR/static/images/" ssh -o StrictHostKeyChecking=no "$SERVER" "nginx -s reload"