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; }