fix: load api_config before generate_pdf call in export_pdf
This commit is contained in:
@@ -626,6 +626,10 @@ def export_pdf(plan_id):
|
||||
except:
|
||||
pass
|
||||
|
||||
# 获取API配置(水印文本等)
|
||||
from app.config import load_api_config
|
||||
api_config = load_api_config(current_app.config)
|
||||
|
||||
# 如果有模板,先渲染
|
||||
rendered_report = None
|
||||
if report_template:
|
||||
@@ -650,6 +654,7 @@ def export_pdf(plan_id):
|
||||
rendered_report = rendered_report.replace("{ai_report}", "(未生成AI报告)")
|
||||
|
||||
problem_tags = ""
|
||||
|
||||
for problem in content.get('problems', []):
|
||||
problem_tags += f"- **{problem.get('name', '')}** ({problem.get('severity', '')})\n"
|
||||
rendered_report = rendered_report.replace("{problem_tags}", problem_tags or "(无)")
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"provider": "minimax",
|
||||
"base_url": "https://api.minimaxi.com/anthropic/v1",
|
||||
"model": "MiniMax-M2.7-highspeed",
|
||||
"temperature": 0.3,
|
||||
"temperature": 0.1,
|
||||
"prompt_template": "",
|
||||
"api_key": "sk-cp-Mj6FHASGAcdc1IhpetY7z4lXCgbkoGAkMbViODPHiVdC-NerbqKRW8ZTCuFliDA9JukoB56ILEYUhDKH2QUJq-xt1ZYNStQ-HNgjRvXIq0H4gOgoxy26xuA"
|
||||
}
|
||||
Reference in New Issue
Block a user