半自动+人工”链路已经落下第一版

This commit is contained in:
yml
2026-04-12 19:07:51 +08:00
parent 4c98b78267
commit 75647e9eed
24 changed files with 711 additions and 93 deletions
+20 -4
View File
@@ -8,17 +8,33 @@ import { clearAdminSession, getAdminRole, getAdminTokenExpiresAt, getAdminUserna
import { formatAdminDateTime } from '@/utils/admin-time'
const router = useRouter()
const isAdmin = computed(() => getAdminRole() === 'admin')
const currentRole = computed(() => getAdminRole())
const isAdmin = computed(() => currentRole.value === 'admin')
const isOperator = computed(() => currentRole.value === 'operator')
const roleLabel = computed(() => {
if (currentRole.value === 'admin') {
return '管理员'
}
if (currentRole.value === 'support') {
return '客服'
}
return '普通运营'
})
const navItems = computed(() => {
const baseItems = [
{ to: '/admin/dashboard', label: '概览' },
{ to: '/admin/orders', label: '订单' },
{ to: '/admin/tasks', label: '任务' },
{ to: '/admin/inventory', label: '库存' },
{ to: '/admin/message-deliveries', label: '消息发送' },
{ to: '/admin/webhook-events', label: 'Webhook' },
]
if (isAdmin.value || isOperator.value) {
baseItems.splice(3, 0, { to: '/admin/inventory', label: '库存' })
baseItems.push({ to: '/admin/webhook-events', label: 'Webhook' })
}
if (isAdmin.value) {
baseItems.splice(1, 0, { to: '/admin/users', label: '用户' })
baseItems.push({ to: '/admin/platform-shops', label: 'Agiso店铺' })
@@ -54,7 +70,7 @@ async function submitLogout() {
<span>当前账号</span>
<strong>{{ getAdminUsername() || '未读取' }}</strong>
<span>当前角色</span>
<strong>{{ getAdminRole() === 'admin' ? '管理员' : '普通运营' }}</strong>
<strong>{{ roleLabel }}</strong>
<span>登录有效期</span>
<strong>{{ formatAdminDateTime(getAdminTokenExpiresAt()) }}</strong>
</div>