commit | b5ef96dd80f0363a9d43a8340dcb8cc575498bd5 | [log] [tgz] |
---|---|---|
author | Krishya <2271857550@qq.com> | Thu Jun 05 13:57:05 2025 +0800 |
committer | Krishya <2271857550@qq.com> | Thu Jun 05 13:57:05 2025 +0800 |
tree | 161f56c4c419f1cde883a877446998ce4396d6ed | |
parent | df48f961ff985acffc4d3f63b3ecbbd2660ac2b5 [diff] [blame] |
修改好友动态、兴趣小组 Change-Id: I8dc8f304f9ac9c968e316bc997b2aeb58b26fe48
diff --git a/src/pages/Forum/posts-main/components/CreatePostButton.jsx b/src/pages/Forum/posts-main/components/CreatePostButton.jsx index e324056..0aa24fb 100644 --- a/src/pages/Forum/posts-main/components/CreatePostButton.jsx +++ b/src/pages/Forum/posts-main/components/CreatePostButton.jsx
@@ -4,6 +4,10 @@ import './CreatePostButton.css'; import { useUser } from '../../../../context/UserContext'; +const user = JSON.parse(localStorage.getItem('user')); // user = { user_id: 123, ... } +const userId = user?.userId; + + const CreatePostButton = () => { const { user } = useUser(); const userId = user?.userId; // 这里改为 userId,跟 UserContext 统一