From 3bc4f9720f92fd58ac7205ef097ddac47286d309 Mon Sep 17 00:00:00 2001 From: qing <1776177662@qq.com> Date: Wed, 29 Jul 2026 14:37:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(dnfs):=20=E7=A7=BB=E5=8A=A8=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=9C=9F=E9=97=B4=E7=A6=81=E7=94=A8=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端 update_note 走 AI 审核耗时较长,confirmMove 期间禁用移动条 与表单按钮,finally 统一恢复 --- static/public/js/dnfs.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/static/public/js/dnfs.js b/static/public/js/dnfs.js index 5336449..2225a36 100644 --- a/static/public/js/dnfs.js +++ b/static/public/js/dnfs.js @@ -363,7 +363,8 @@ function renderMoveBar() { movebar.appendChild(cancel_btn); } -/* by qing — 执行移动:把待移动节点挂到当前层(stack 顶,根为 0) */ +/* by qing — 执行移动:把待移动节点挂到当前层(stack 顶,根为 0)。 + * 后端 update_note 会走 AI 内容审核,耗时较长,期间禁用移动条与表单按钮防止重复提交 */ async function confirmMove() { if (moving_node == null) { return; @@ -377,10 +378,22 @@ async function confirmMove() { alert('该节点已在当前层'); return; } - var result = await moveNode(moving_node.id, target_pid, moving_node.title, moving_node.content); - if (result != null) { - moving_node = null; - renderMoveBar(); + // 防重复点击:请求进行中禁用按钮(成功/失败都在 finally 恢复) + movebar.querySelectorAll('button').forEach(function(b) { b.disabled = true; }); + input_note_submit.disabled = true; + input_note_clear.disabled = true; + delete_note.disabled = true; + try { + var result = await moveNode(moving_node.id, target_pid, moving_node.title, moving_node.content); + if (result != null) { + moving_node = null; + renderMoveBar(); + } + } finally { + movebar.querySelectorAll('button').forEach(function(b) { b.disabled = false; }); + input_note_submit.disabled = false; + input_note_clear.disabled = false; + delete_note.disabled = false; } }