feat: 后台管理功能增强

1. 前端用户下拉菜单优化 - 改用CSS动画,解决鼠标移动问题
2. 帖子管理增加显示/隐藏开关
3. 帖子详情页可直接删除回复
4. 新增回复管理页面(列表、删除)
5. 用户管理增加编辑功能(用户名、邮箱、手机、简介)
6. 用户管理增加查看帖子按钮
7. 所有页面侧边栏添加回复管理入口
8. 数据库增加 is_hidden 字段
This commit is contained in:
2026-04-12 18:16:36 +08:00
parent e7ebc3a4d6
commit cd087e9931
9 changed files with 458 additions and 48 deletions

View File

@@ -146,14 +146,19 @@
<a href="/create" class="px-4 py-2 gradient-bg text-white rounded-lg text-sm hidden sm:block">
发布帖子
</a>
<div class="relative group">
<button class="flex items-center gap-2">
<div class="dropdown relative">
<button class="flex items-center gap-2 cursor-pointer">
<img src="${currentUser.avatar}" class="w-8 h-8 rounded-full">
<span class="hidden sm:inline text-gray-700">${currentUser.username}</span>
<i class="ri-arrow-down-s-line text-gray-400"></i>
</button>
<div class="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-100 hidden group-hover:block">
<a href="/user/${currentUser.id}" class="block px-4 py-2 text-gray-700 hover:bg-gray-50">个人主页</a>
<button onclick="logout()" class="block w-full text-left px-4 py-2 text-red-500 hover:bg-gray-50">退出登录</button>
<div class="dropdown-menu py-2">
<a href="/user/${currentUser.id}" class="flex items-center gap-2 px-4 py-2 text-gray-700 hover:bg-gray-50">
<i class="ri-user-line"></i> 个人主页
</a>
<button onclick="logout()" class="flex items-center gap-2 w-full text-left px-4 py-2 text-red-500 hover:bg-gray-50">
<i class="ri-logout-box-line"></i> 退出登录
</button>
</div>
</div>
</div>
@@ -325,4 +330,15 @@
}
</script>
</body>
</html>hModal').classList.remove('hidden');
document.getElementById('searchModal').classList.add('flex');
}
});
function closeSearchModal() {
document.getElementById('searchModal').classList.add('hidden');
document.getElementById('searchModal').classList.remove('flex');
}
</script>
</body>
</html>