🐛 修复主题偏好刷新后丢失的问题
原因: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:
@@ -102,7 +102,9 @@ function authMiddleware(req, res, next) {
|
|||||||
storage_permission: user.storage_permission || 'sftp_only',
|
storage_permission: user.storage_permission || 'sftp_only',
|
||||||
current_storage_type: user.current_storage_type || 'sftp',
|
current_storage_type: user.current_storage_type || 'sftp',
|
||||||
local_storage_quota: user.local_storage_quota || 1073741824,
|
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();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user