fix: 修复生成按钮 PUT 状态限制 + 进度弹窗错误显示 #377
@@ -955,12 +955,16 @@ const EditingPlanner: React.FC = () => {
|
||||
let planId = loadedPlanId;
|
||||
|
||||
if (planId) {
|
||||
// 已有计划 → 更新配置
|
||||
await updateEditPlan(planId, {
|
||||
config,
|
||||
total_duration: totalDuration,
|
||||
status: "editing",
|
||||
});
|
||||
// 已有计划 → 更新配置(不传 status,避免非 draft 状态被后端拒绝)
|
||||
try {
|
||||
await updateEditPlan(planId, {
|
||||
config,
|
||||
total_duration: totalDuration,
|
||||
});
|
||||
} catch (updateErr) {
|
||||
// 非 draft 状态(如 failed/editing)PUT 会被拒绝,忽略继续生成
|
||||
console.warn("[计划更新跳过]", updateErr);
|
||||
}
|
||||
} else {
|
||||
// 无计划 → 创建新计划
|
||||
const plan = await createEditPlan({
|
||||
|
||||
Reference in New Issue
Block a user