From 74f25ce3ed60a4603595eff89157d15e0f9e25dc Mon Sep 17 00:00:00 2001 From: WanWanYun Date: Wed, 12 Nov 2025 23:10:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0SFTP=E8=AE=BE=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E5=93=8D=E5=BA=94=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 问题:当用户已在settings页面时,switchView方法会检测到重复而直接return - 修复:直接设置currentView并手动调用loadFtpConfig() - 确保无论用户在哪个页面,点击确认后都能正确跳转到设置页面 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/app.js b/frontend/app.js index 129e67f..1921b52 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1581,7 +1581,12 @@ handleDragLeave(e) { if (type === 'sftp' && !this.user.has_ftp_config) { const goToSettings = confirm('您还未配置SFTP服务器。\n\n是否现在前往设置页面进行配置?配置完成后将自动切换到SFTP存储。'); if (goToSettings) { - this.switchView('settings'); + // 直接设置视图并加载配置,避免switchView的重复检查 + this.currentView = 'settings'; + // 如果是普通用户,手动加载SFTP配置 + if (this.user && !this.user.is_admin) { + this.loadFtpConfig(); + } } return; }