🐛 修复主题偏好刷新后丢失的问题

原因:authMiddleware 中的 req.user 对象没有包含 theme_preference 字段,
导致 /api/user/theme 接口始终返回 undefined,用户设置的主题无法被正确读取。

修复:在 req.user 中添加 theme_preference 字段

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-27 23:25:25 +08:00
parent 0cd8341faf
commit 209aa4a865

View File

@@ -102,7 +102,9 @@ function authMiddleware(req, res, next) {
storage_permission: user.storage_permission || 'sftp_only',
current_storage_type: user.current_storage_type || 'sftp',
local_storage_quota: user.local_storage_quota || 1073741824,
local_storage_used: user.local_storage_used || 0
local_storage_used: user.local_storage_used || 0,
// 主题偏好
theme_preference: user.theme_preference || null
};
next();