修复: 解决切换到SFTP配置页面无响应的根本问题
问题分析: 1. SFTP配置区域的v-if条件包含了storageType检查 2. 当用户为local存储时,SFTP配置区域被隐藏 3. 即使跳转到settings页面,用户也看不到SFTP配置表单 修复内容: 1. 移除SFTP配置区域v-if中的storageType检查 2. 只要用户权限允许SFTP,配置区域就始终可见 3. 添加id属性,方便定位和滚动 4. 在switchStorage中添加平滑滚动到SFTP配置区域的逻辑 5. 使用$nextTick确保DOM更新后再滚动 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1005,7 +1005,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- SFTP配置 - 仅普通用户且权限允许SFTP -->
|
<!-- SFTP配置 - 仅普通用户且权限允许SFTP -->
|
||||||
<div v-if="user && !user.is_admin && (storagePermission === 'sftp_only' || (storagePermission === 'user_choice' && storageType === 'sftp'))">
|
<div v-if="user && !user.is_admin && (storagePermission === 'sftp_only' || storagePermission === 'user_choice')" id="sftp-config-section">
|
||||||
<h3 style="margin-bottom: 20px;">SFTP配置</h3>
|
<h3 style="margin-bottom: 20px;">SFTP配置</h3>
|
||||||
<div v-if="user && !user.has_ftp_config" class="alert alert-info">
|
<div v-if="user && !user.has_ftp_config" class="alert alert-info">
|
||||||
请配置SFTP服务器
|
请配置SFTP服务器
|
||||||
|
|||||||
@@ -1587,6 +1587,13 @@ handleDragLeave(e) {
|
|||||||
if (this.user && !this.user.is_admin) {
|
if (this.user && !this.user.is_admin) {
|
||||||
this.loadFtpConfig();
|
this.loadFtpConfig();
|
||||||
}
|
}
|
||||||
|
// 等待DOM更新后滚动到SFTP配置区域
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const sftpSection = document.getElementById('sftp-config-section');
|
||||||
|
if (sftpSection) {
|
||||||
|
sftpSection.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user