fix: 修复Logo缺失问题并更新部署脚本

This commit is contained in:
菜鸟生产 2026-03-18 11:03:08 +08:00
parent 3da50776c3
commit 1b94afd90b
3 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,9 @@
# FastAPI 应用入口 # FastAPI 应用入口
import os import os
from pathlib import Path from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
from fastapi import FastAPI from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles

View File

@ -1,12 +1,12 @@
{ {
"name": "jiachenlong-frontend", "name": "jiachenlong-frontend",
"version": "1.0.0", "version": "1.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "jiachenlong-frontend", "name": "jiachenlong-frontend",
"version": "1.0.0", "version": "1.0.1",
"dependencies": { "dependencies": {
"axios": "^1.7.9", "axios": "^1.7.9",
"react": "^18.3.1", "react": "^18.3.1",

View File

@ -88,16 +88,20 @@ elif [ "$ENV" == "test" ]; then
log_info "测试环境部署完成http://120.26.133.10/" log_info "测试环境部署完成http://120.26.133.10/"
elif [ "$ENV" == "production" ]; then elif [ "$ENV" == "production" ]; then
# 生产服务器 # 生产服务器 A (WebA: 8.154.46.3)
SERVER="root@8.149.137.26" SERVER="root@8.154.46.3"
DEST_DIR="/var/www/html" DEPLOY_DIR="/var/www/frontend"
# 部署前端构建文件 # 部署前端构建文件
cd "$PROJECT_ROOT/frontend/dist" 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 # 部署静态资源(包含 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/" scp -o StrictHostKeyChecking=no "$PROJECT_ROOT/static/images/jiachenlong-logo.png" "$SERVER:$DEST_DIR/static/images/"
ssh -o StrictHostKeyChecking=no "$SERVER" "nginx -s reload" ssh -o StrictHostKeyChecking=no "$SERVER" "nginx -s reload"