chore: sync local changes (2026-03-12)

This commit is contained in:
2026-03-12 18:58:40 +08:00
parent 1123d6aef2
commit 4cc8ec9486
21 changed files with 4561 additions and 270 deletions

View File

@@ -7,9 +7,20 @@ import string
from datetime import datetime, timedelta
app = Flask(__name__)
CORS(app)
# 配置CORS允许前端服务器访问
CORS(app, origins=[
"http://192.168.1.100:8989", # 前端服务器
"http://localhost:8989", # 本地测试
"http://127.0.0.1:8989", # 本地测试
"http://short.shumengya.top", # 前端域名(如果有)
"https://short.shumengya.top" # 前端域名HTTPS如果有
])
DATA_FILE = 'link_data.json'
# 数据文件路径(支持持久化挂载)
DATA_DIR = os.getenv('DATA_DIR', '/app/data')
if not os.path.exists(DATA_DIR):
os.makedirs(DATA_DIR)
DATA_FILE = os.path.join(DATA_DIR, 'link_data.json')
def load_links():
"""加载链接数据"""