From 1c8eded07e2c68d6084ead1805330babd379dfd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=BB=E5=8B=87=E7=A5=A5?= <237899745@qq.com> Date: Mon, 24 Nov 2025 20:59:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20=E4=BC=98=E5=8C=96=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E9=85=8D=E7=BD=AE=E6=8F=90=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端优化: - 新增 profileInitialized 标志,避免首次加载时显示误导性提示 - 新增 suppressStorageToast 标志,用户主动切换后不显示配置同步提示 - 首次加载时只同步存储配置,不弹出提示 - 用户主动切换存储方式后,下一次配置同步不提示"管理员已修改" 用户体验改进: - 避免用户刚登录就看到"管理员已更改存储方式"的误导提示 - 区分用户主动操作和管理员修改操作 - 减少不必要的提示干扰 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/app.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/app.js b/frontend/app.js index 27da683..5b1e7e1 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -212,6 +212,8 @@ createApp({ // 存储切换状态 storageSwitching: false, storageSwitchTarget: null, + suppressStorageToast: false, + profileInitialized: false, // SFTP配置引导弹窗 showSftpGuideModal: false, @@ -1786,12 +1788,22 @@ handleDragLeave(e) { this.storagePermission = newStoragePermission; this.storageType = newStorageType; + // 首次加载仅同步,不提示 + if (!this.profileInitialized) { + this.profileInitialized = true; + return; + } + // 如果存储类型被管理员更改,通知用户并重新加载文件 if (oldStorageType !== newStorageType || oldStoragePermission !== newStoragePermission) { console.log('[存储配置更新] 旧类型:', oldStorageType, '新类型:', newStorageType); console.log('[存储配置更新] 旧权限:', oldStoragePermission, '新权限:', newStoragePermission); - this.showToast('info', '存储配置已更新', `管理员已将您的存储方式更改为${newStorageType === 'local' ? '本地存储' : 'SFTP存储'}`); + if (!this.suppressStorageToast) { + this.showToast('info', '存储配置已更新', `管理员已将您的存储方式更改为${newStorageType === 'local' ? '本地存储' : 'SFTP存储'}`); + } else { + this.suppressStorageToast = false; + } // 如果当前在文件页面,重新加载文件列表 if (this.currentView === 'files') { @@ -1853,6 +1865,8 @@ handleDragLeave(e) { if (response.data.success) { this.storageType = type; + // 用户主动切换后,下一次配置同步不提示管理员修改 + this.suppressStorageToast = true; this.showToast('success', '成功', `已切换到${type === 'local' ? '本地存储' : 'SFTP存储'}`); // 重新加载文件列表