Merge branch 'master' of https://gitea.airlabs.art/zyc/airlabs-manage
All checks were successful
Build and Deploy Backend / build-and-deploy (push) Successful in 1m21s
Build and Deploy Web / build-and-deploy (push) Successful in 1m2s

This commit is contained in:
seaislee1209 2026-02-12 15:29:29 +08:00
commit 268c89e15c
8 changed files with 13 additions and 12 deletions

View File

@ -9,5 +9,8 @@ SECRET_KEY = os.getenv("SECRET_KEY", "airlabs-project-secret-key-change-in-produ
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24 # 24 小时
# CORS
CORS_ORIGINS = os.getenv("CORS_ORIGINS", "*").split(",")
# 成本计算
WORKING_DAYS_PER_MONTH = 22

View File

@ -13,10 +13,11 @@ Base.metadata.create_all(bind=engine)
app = FastAPI(title="AirLabs Project", version="1.0.0")
# CORS开发阶段允许所有来源
# CORS
from config import CORS_ORIGINS
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_origins=CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],

View File

@ -4,4 +4,5 @@ sqlalchemy
pydantic
python-jose[cryptography]
passlib[bcrypt]
bcrypt==4.0.1
python-multipart

View File

@ -0,0 +1 @@
VITE_API_BASE_URL=http://localhost:8000/api

1
frontend/.env.production Normal file
View File

@ -0,0 +1 @@
VITE_API_BASE_URL=https://airlabs-manage-api.airlabs.art/api

View File

@ -2,15 +2,6 @@ server {
listen 80;
server_name localhost;
# API 代理到后端服务K8s 内部通信)
location /api {
proxy_pass http://airlabs-manage-backend:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;

View File

@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus'
import router from '../router'
const api = axios.create({
baseURL: '/api',
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
timeout: 30000,
})

View File

@ -39,6 +39,9 @@ spec:
# 生产环境 JWT 密钥(部署前请修改)
- name: SECRET_KEY
value: "Ui5-xEvtAhKRDtlXKzDfd7TElsVZFUhakff0qcjn8jU"
# CORS 允许的域名
- name: CORS_ORIGINS
value: "https://airlabs-manage-web.airlabs.art"
volumeMounts:
- name: sqlite-data
mountPath: /app/data