fix: AI daily review sqlite3.Row crash and error feedback across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1236,14 +1236,16 @@ function genDaily(){
|
||||
const d = document.getElementById("day_date").value;
|
||||
if(!d){alert("请选择日期");return;}
|
||||
fetch("/ai_daily_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`date=${encodeURIComponent(d)}`})
|
||||
.then(r=>r.json()).then(data=>{
|
||||
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
|
||||
.then(data=>{
|
||||
const el=document.getElementById("daily_result");
|
||||
const wrap=document.getElementById("daily_result_wrap");
|
||||
setAiReviewMarkdown(el, data.result);
|
||||
if(wrap){ wrap.style.display="block"; }
|
||||
else { el.style.display="block"; }
|
||||
loadReviews();
|
||||
});
|
||||
})
|
||||
.catch(e=>alert("生成日复盘失败:"+(e.message||e)));
|
||||
}
|
||||
|
||||
function genWeekly(){
|
||||
@@ -1251,14 +1253,16 @@ function genWeekly(){
|
||||
const e=document.getElementById("week_end").value;
|
||||
if(!s || !e){alert("请选择起止日期");return;}
|
||||
fetch("/ai_weekly_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`start_date=${encodeURIComponent(s)}&end_date=${encodeURIComponent(e)}`})
|
||||
.then(r=>r.json()).then(data=>{
|
||||
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
|
||||
.then(data=>{
|
||||
const el=document.getElementById("weekly_result");
|
||||
const wrap=document.getElementById("weekly_result_wrap");
|
||||
setAiReviewMarkdown(el, data.result);
|
||||
if(wrap){ wrap.style.display="block"; }
|
||||
else { el.style.display="block"; }
|
||||
loadReviews();
|
||||
});
|
||||
})
|
||||
.catch(e=>alert("生成周复盘失败:"+(e.message||e)));
|
||||
}
|
||||
|
||||
function exportDailyBundleMd(){
|
||||
|
||||
Reference in New Issue
Block a user