diff --git a/msh_single_uniapp/pages/tool/post-detail.vue b/msh_single_uniapp/pages/tool/post-detail.vue
index c26476f..0fed677 100644
--- a/msh_single_uniapp/pages/tool/post-detail.vue
+++ b/msh_single_uniapp/pages/tool/post-detail.vue
@@ -100,8 +100,9 @@
{{ postData.author.time }}
-
@@ -256,11 +257,14 @@ import {
getCommunityList
} from '@/api/tool.js'
import { checkLogin, toLogin } from '@/libs/login.js'
+import Cache from '@/utils/cache'
+import { USER_INFO } from '@/config/cache'
export default {
data() {
return {
postId: null,
+ currentUserId: null,
currentImageIndex: 0,
isLoading: true,
isFollowed: false,
@@ -312,6 +316,10 @@ export default {
}
},
onLoad(options) {
+ const userInfo = Cache.get(USER_INFO, true)
+ if (userInfo) {
+ this.currentUserId = userInfo.uid || userInfo.id || null
+ }
if (options.id) {
// Ensure postId is number for API calls (URL params are strings)
this.postId = parseInt(options.id, 10) || options.id