diff --git a/config/VERSION b/config/VERSION
index 5306092..85b0ff0 100644
--- a/config/VERSION
+++ b/config/VERSION
@@ -1 +1 @@
-VERSION=1.2.47
+VERSION=1.2.48
diff --git a/frontend/index.html b/frontend/index.html
index 44beab4..d6edbe5 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -4,7 +4,7 @@
-
{[
- { key: 'manage', label: '📋 发布管理' },
- { key: 'yichens', label: '📊 一尘看板' }
+ { key: 'manage', label: '📋 发布管理' }
].map(tab => (
)}
-
- {/* 一尘看板页 */}
- {activeTab === 'yichens' && (
-
- )}
)
}
-// ============ 一尘看板组件 ============
-function YichensBoard() {
- const [stats, setStats] = useState({ posts: null, categories: [], users: null })
- const [posts, setPosts] = useState([])
- const [loading, setLoading] = useState(false)
- const [expandedPosts, setExpandedPosts] = useState({})
- const [postTypeFilter, setPostTypeFilter] = useState('all')
-
- const API_BASE = localStorage.getItem('API_BASE') || ''
-
- useEffect(() => {
- fetchStats()
- fetchPosts()
- }, [])
-
- const fetchStats = async () => {
- try {
- const [postsRes, catRes, usersRes] = await Promise.all([
- fetch(`${API_BASE}/api/yichens/stats/posts?days=30`),
- fetch(`${API_BASE}/api/yichens/stats/categories?days=30`),
- fetch(`${API_BASE}/api/yichens/stats/users`)
- ])
- const postsData = await postsRes.json()
- const catData = await catRes.json()
- const usersData = await usersRes.json()
- setStats({ posts: postsData, categories: catData, users: usersData })
- } catch (e) {
- console.error('获取统计失败:', e)
- }
- }
-
- const fetchPosts = async () => {
- setLoading(true)
- try {
- let url = `${API_BASE}/api/yichens/posts?limit=50`
- if (postTypeFilter !== 'all') url += `&post_type=${postTypeFilter}`
- const res = await fetch(url)
- const data = await res.json()
- setPosts(data || [])
- } catch (e) {
- console.error('获取帖子失败:', e)
- }
- setLoading(false)
- }
-
- const togglePostExpand = (postId) => {
- setExpandedPosts(prev => ({ ...prev, [postId]: !prev[postId] }))
- }
-
- const filteredPosts = postTypeFilter === 'all'
- ? posts
- : posts.filter(p => p.post_type === postTypeFilter)
-
- return (
-
- {stats.posts && (
-
-
-
30天帖子
-
{stats.posts.total_posts}
-
出售{stats.posts.total_deals} 求购{stats.posts.total_wants}
-
-
-
浏览量
-
{(stats.posts.total_views / 10000).toFixed(1)}万
-
回复{stats.posts.total_replies}
-
-
-
用户数
-
{stats.users?.total_users || 0}
-
今日新增{stats.users?.new_users_today || 0}
-
-
- )}
-
-
-
📊 分类统计
-
- {stats.categories.map(cat => (
-
- {cat.category} ({cat.count})
-
- ))}
-
-
-
-
- {[
- { key: 'all', label: '全部' },
- { key: 'deal', label: '出售' },
- { key: 'want', label: '求购' }
- ].map(ft => (
-
- ))}
-
-
- {loading ? (
-
加载中...
- ) : (
-
- {filteredPosts.map(post => (
-
-
togglePostExpand(post.post_id)} style={{ cursor: 'pointer' }}>
-
- {post.title || '无标题'}
-
- {post.post_type === 'deal' ? '出售' : post.post_type === 'want' ? '求购' : '普通'}
-
-
-
- {post.author_username || '未知'}
- {post.post_time ? post.post_time.substring(0, 16) : ''}
-
-
-
- {expandedPosts[post.post_id] && (
-
-
-
分类: {post.category || '-'}
-
价格: {post.price ? post.price.toLocaleString() + '元' : '待询'}
-
浏览: {post.view_count || 0}
-
回复: {post.reply_count || 0}
-
- {post.url && (
-
- 查看原帖
-
- )}
-
- )}
-
- ))}
-
- )}
-
- )
-}