diff --git a/pages/case/plan-list.vue b/pages/case/plan-list.vue index ccbe7e8..6df936a 100644 --- a/pages/case/plan-list.vue +++ b/pages/case/plan-list.vue @@ -240,10 +240,21 @@ function onSearchInput() { function canToggleFavorite(plan) { if (!plan || !plan._id) return false; + if (isCreatedByCurrentUser(plan)) return false; if (activeViewType.value !== 'my') return true; return Boolean(plan.isFavorite); } +function isCreatedByCurrentUser(plan = {}) { + const userId = getUserId(); + if (!userId) return false; + if (String(plan.createor || plan.creator || '') === userId) return true; + const signature = plan.creatorSignature && typeof plan.creatorSignature === 'object' + ? plan.creatorSignature + : null; + return signature?.type === 'personal' && String(signature.person?.userId || '') === userId; +} + async function toggleFavorite(plan) { const corpId = getCorpId(); const userId = getUserId();