fix: 管理配方tab所有人可见,未登录时显示登录引导
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 22s
Test / e2e-test (push) Successful in 51s

撤回之前的editor-only限制,改为tab可见但页面内容需登录。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 10:20:45 +00:00
parent f149154a56
commit 0f7ae6ecc7
2 changed files with 13 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
<template>
<div class="recipe-manager">
<!-- Login prompt for non-logged-in users -->
<div v-if="!auth.isLoggedIn" class="login-prompt">
<p>登录后可管理配方创建个人配方集</p>
<button class="btn-primary" @click="ui.openLogin()">登录 / 注册</button>
</div>
<template v-else>
<!-- Review Bar (admin + senior_editor with assigned reviews) -->
<div v-if="(auth.isAdmin || auth.canManage) && pendingCount > 0" class="review-bar" @click="showPending = !showPending" >
📝 待审核配方: {{ pendingCount }}
@@ -388,6 +394,7 @@
@save="onTagPickerSave"
@close="showTagPicker = false"
/>
</template>
</div>
</template>
@@ -1672,6 +1679,11 @@ watch(() => recipeStore.recipes, () => {
padding: 0 12px 24px;
}
.login-prompt {
text-align: center; padding: 60px 20px; color: #6b6375;
}
.login-prompt p { margin-bottom: 16px; font-size: 15px; }
.review-bar {
background: linear-gradient(135deg, #fff3e0, #ffe0b2);
padding: 12px 16px;