feat: 添加 API 密钥菜单和文档链接
- 侧边栏添加 API 密钥菜单项 - API 密钥列表页添加 API 文档链接 - 添加 /docs/ 路由服务文档文件 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
9
app.py
9
app.py
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user