feat: 添加 API 密钥菜单和文档链接

- 侧边栏添加 API 密钥菜单项
- API 密钥列表页添加 API 文档链接
- 添加 /docs/ 路由服务文档文件

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jowe
2026-03-23 23:19:48 +08:00
parent 946e7197ae
commit 76ae3cbb5a
3 changed files with 36 additions and 1 deletions

9
app.py
View File

@@ -83,6 +83,15 @@ def create_app(config_name='default'):
return AdminModel.query.get(int(user_id))
return None
# ========== 文档路由 ==========
@app.route('/docs/<path:filename>')
def serve_doc(filename):
"""服务文档文件"""
from flask import send_from_directory
import os
docs_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'docs')
return send_from_directory(docs_dir, filename)
# ========== 前台路由 ==========
@app.route('/')
def index():