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 3s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Successful in 49s

未登录用户和viewer不再看到管理配方tab。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 10:12:03 +00:00
parent b3c658b496
commit 4d855627e8

View File

@@ -78,7 +78,7 @@ const navTabsRef = ref(null)
// hide: 完全隐藏(只有满足条件才显示)
const allTabs = [
{ key: 'search', icon: '🔍', label: '配方查询' },
{ key: 'manage', icon: '📋', label: '管理配方', require: 'login' },
{ key: 'manage', icon: '📋', label: '管理配方', hide: 'editor' },
{ key: 'inventory', icon: '📦', label: '个人库存', require: 'login' },
{ key: 'oils', icon: '💧', label: '精油价目' },
{ key: 'projects', icon: '💼', label: '商业核算', require: 'login' },
@@ -88,6 +88,7 @@ const allTabs = [
const visibleTabs = computed(() => allTabs.filter(t => {
if (!t.hide) return true
if (t.hide === 'admin') return auth.isAdmin
if (t.hide === 'editor') return auth.canEdit
return true
}))
const unreadNotifCount = ref(0)