From 175087c89444c36729c9f5f825804023ff6d76de Mon Sep 17 00:00:00 2001 From: WanWanYun Date: Wed, 12 Nov 2025 09:13:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20SFTP=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=97=AE=E9=A2=98=20&=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=80=85=E5=B7=A5=E5=85=B7=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复SFTP按钮被错误禁用的问题 - 用户选择本地存储后可以正常切换回SFTP - 切换到SFTP时检查是否已配置,未配置则跳转到设置页面 - 添加右键菜单禁用 - 添加F12和开发者工具快捷键禁用 - 添加开发者工具打开检测 - 生产环境禁用console输出 --- frontend/app.html | 73 ++++++++++++++++++++++++++++++++++++++++++++++- frontend/app.js | 7 +++++ 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/frontend/app.html b/frontend/app.html index e47d1a9..02639f2 100644 --- a/frontend/app.html +++ b/frontend/app.html @@ -930,7 +930,7 @@ class="btn" :class="storageType === 'sftp' ? 'btn-primary' : 'btn-secondary'" @click="switchStorage('sftp')" - :disabled="storageType === 'sftp' || !user.has_ftp_config"> + :disabled="storageType === 'sftp'"> SFTP存储 @@ -2007,5 +2007,76 @@ + + + diff --git a/frontend/app.js b/frontend/app.js index 7cb4912..68a1b19 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1483,6 +1483,13 @@ handleDragLeave(e) { // 用户切换存储方式 async switchStorage(type) { + // 检查是否尝试切换到SFTP但未配置 + if (type === 'sftp' && !this.user.has_ftp_config) { + this.showToast('warning', '提示', '请先在设置页面配置SFTP信息'); + this.currentView = 'settings'; + return; + } + if (!confirm(`确定要切换到${type === 'local' ? '本地存储' : 'SFTP存储'}吗?`)) { return; }