fix: 订阅模式登录验证、永久会员类型区分、动态代码HTTP返回值修复、侧边栏滚动位置保持
- 修复订阅模式登录时错误检查余额的问题 - 区分无限余额和永久订阅两种永久会员类型 - 修复动态代码HTTP请求返回值在JS中无法正确访问的问题 - 添加侧边栏滚动位置保持功能 - 移除developer角色相关代码,统一使用admin - 添加缺失的i18n翻译key
This commit is contained in:
@@ -1,22 +1,107 @@
|
||||
<script setup lang="ts">
|
||||
import Footer from '@/components/marketing-layout/the-footer.vue'
|
||||
import Header from '@/components/marketing-layout/the-header.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import AdminSidebar from '@/components/admin-sidebar/index.vue'
|
||||
import LanguageChange from '@/components/language-change.vue'
|
||||
import ThemePopover from '@/components/custom-theme/theme-popover.vue'
|
||||
import ToggleTheme from '@/components/toggle-theme.vue'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const breadcrumbs = computed(() => {
|
||||
const path = router.currentRoute.value.path
|
||||
const parts = path.split('/').filter(Boolean)
|
||||
const crumbs = [{ title: '控制台', path: '/admin' }]
|
||||
|
||||
const titleMap: Record<string, string> = {
|
||||
applications: '应用管理',
|
||||
cards: '卡密管理',
|
||||
users: '用户管理',
|
||||
devices: '设备管理',
|
||||
sessions: '在线实例',
|
||||
announcements: '公告管理',
|
||||
versions: '版本管理',
|
||||
'card-types': '卡类管理',
|
||||
'agent-apps': '代理授权',
|
||||
agents: '代理管理',
|
||||
finance: '财务管理',
|
||||
logs: '日志记录',
|
||||
tickets: '工单系统',
|
||||
'cloud-constants': '云端常量',
|
||||
'cloud-variables': '云端变量',
|
||||
'cloud-function': '云端函数',
|
||||
'risk-control': '风控管理',
|
||||
extension: '扩展配置',
|
||||
profile: '个人中心',
|
||||
settings: '基本设置',
|
||||
security: '安全设置',
|
||||
email: '邮箱设置',
|
||||
create: '创建',
|
||||
edit: '编辑',
|
||||
recharge: '充值',
|
||||
request: '申请授权',
|
||||
invite: '邀请授权',
|
||||
}
|
||||
|
||||
let currentPath = '/admin'
|
||||
for (let i = 1; i < parts.length; i++) {
|
||||
const part = parts[i]
|
||||
currentPath += `/${part}`
|
||||
|
||||
if (titleMap[part]) {
|
||||
crumbs.push({
|
||||
title: titleMap[part],
|
||||
path: currentPath,
|
||||
})
|
||||
}
|
||||
else if (!isNaN(Number(part)) && i === parts.length - 1) {
|
||||
crumbs.push({
|
||||
title: '详情',
|
||||
path: currentPath,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return crumbs
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen flex flex-col">
|
||||
<Header />
|
||||
<UiSidebarProvider>
|
||||
<AdminSidebar />
|
||||
<UiSidebarInset>
|
||||
<header class="flex h-14 shrink-0 items-center gap-2 border-b px-4">
|
||||
<UiSidebarTrigger class="-ml-1" />
|
||||
<UiSeparator orientation="vertical" class="mr-2 h-4" />
|
||||
<UiBreadcrumb>
|
||||
<UiBreadcrumbList>
|
||||
<template v-for="(crumb, index) in breadcrumbs" :key="crumb.path">
|
||||
<UiBreadcrumbItem v-if="index < breadcrumbs.length - 1">
|
||||
<UiBreadcrumbLink as-child>
|
||||
<router-link :to="crumb.path">
|
||||
{{ crumb.title }}
|
||||
</router-link>
|
||||
</UiBreadcrumbLink>
|
||||
</UiBreadcrumbItem>
|
||||
<UiBreadcrumbItem v-else>
|
||||
<UiBreadcrumbPage>{{ crumb.title }}</UiBreadcrumbPage>
|
||||
</UiBreadcrumbItem>
|
||||
<UiBreadcrumbSeparator v-if="index < breadcrumbs.length - 1" />
|
||||
</template>
|
||||
</UiBreadcrumbList>
|
||||
</UiBreadcrumb>
|
||||
|
||||
<main class="flex-1">
|
||||
<div class="relative bg-background">
|
||||
<div class="py-8 lg:py-12">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
|
||||
<router-view />
|
||||
</div>
|
||||
<div class="ml-auto flex items-center gap-2">
|
||||
<LanguageChange />
|
||||
<ToggleTheme />
|
||||
<ThemePopover />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</header>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
<main class="flex-1 overflow-auto p-4 md:p-6">
|
||||
<router-view />
|
||||
</main>
|
||||
</UiSidebarInset>
|
||||
</UiSidebarProvider>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user