diff --git a/Merge/front/src/components/HomeFeed.jsx b/Merge/front/src/components/HomeFeed.jsx
index e32a2eb..cc37642 100644
--- a/Merge/front/src/components/HomeFeed.jsx
+++ b/Merge/front/src/components/HomeFeed.jsx
@@ -5,6 +5,7 @@
 import { ThumbsUp } from 'lucide-react'
 import { fetchPosts, fetchPost } from '../api/posts_wzy'
 import { searchAPI } from '../api/search_jwlll'
+import { getUserInfo } from '../utils/auth'
 import '../style/HomeFeed.css'
 
 const categories = [
@@ -17,11 +18,17 @@
   { label: '协同过滤推荐', value: 'cf' }
 ]
 
-const DEFAULT_USER_ID = '3' // 确保数据库有此用户
+const DEFAULT_USER_ID = '3' // 确保数据库有此用户（作为回退值）
 const DEFAULT_TAGS = ['美食','影视','穿搭'] // 可根据实际数据库调整
 
 export default function HomeFeed() {
   const navigate = useNavigate()
+  
+  // 获取当前用户ID，如果未登录则使用默认值
+  const getCurrentUserId = () => {
+    const userInfo = getUserInfo()
+    return userInfo?.id ? String(userInfo.id) : DEFAULT_USER_ID
+  }
   const [activeCat, setActiveCat] = useState('推荐')
   const [items, setItems]         = useState([])
   const [loading, setLoading]     = useState(true)
@@ -55,13 +62,13 @@
     }
     setLoading(false)
   }, [activeCat])
-
   // 标签推荐
   const fetchTagRecommend = useCallback(async (tags) => {
     setLoading(true)
     setError(null)
     try {
-      const data = await searchAPI.recommendByTags(DEFAULT_USER_ID, tags)
+      const currentUserId = getCurrentUserId()
+      const data = await searchAPI.recommendByTags(currentUserId, tags)
       const formattedItems = (data.recommendations || []).map(item => ({
         id: item.id,
         title: item.title,
@@ -79,13 +86,13 @@
     }
     setLoading(false)
   }, [])
-
   // 协同过滤推荐
   const fetchCFRecommend = useCallback(async (topN = recCFNum) => {
     setLoading(true)
     setError(null)
     try {
-      const data = await searchAPI.userBasedRecommend(DEFAULT_USER_ID, topN)
+      const currentUserId = getCurrentUserId()
+      const data = await searchAPI.userBasedRecommend(currentUserId, topN)
       const formattedItems = (data.recommendations || []).map(item => ({
         id: item.id,
         title: item.title,
@@ -103,14 +110,14 @@
     }
     setLoading(false)
   }, [recCFNum])
-
   // 获取用户兴趣标签后再推荐
   const fetchUserTagsAndRecommend = useCallback(async () => {
     setLoading(true)
     setError(null)
     let tags = []
     try {
-      const data = await searchAPI.getUserTags(DEFAULT_USER_ID)
+      const currentUserId = getCurrentUserId()
+      const data = await searchAPI.getUserTags(currentUserId)
       tags = Array.isArray(data.tags) && data.tags.length > 0 ? data.tags : DEFAULT_TAGS
     } catch {
       tags = DEFAULT_TAGS
