仓库模块完了

This commit is contained in:
2026-02-08 20:06:35 +08:00
parent 20e1deae21
commit f145df4fa6
29 changed files with 1415 additions and 993 deletions

View File

@@ -77,14 +77,7 @@ const routes: Array<RouteRecordRaw> = [
title: '用户管理'
}
},
{
path: 'api-keys',
name: 'AdminApiKeys',
component: () => import('../views/admin/AdminApiKeysView.vue'),
meta: {
title: 'API密钥管理'
}
},
{
path: 'api',
name: 'AdminApiManagement',
@@ -157,7 +150,9 @@ router.beforeEach((to, _from, next) => {
if (to.meta.requiresAdmin) {
try {
const userObj = JSON.parse(user)
if (userObj.role !== 'admin') {
// 检查用户是否为管理员,支持多种格式
const isAdmin = userObj.role?.name === 'admin' || userObj.role_name === 'admin'
if (!isAdmin) {
next({ name: 'Home' })
return
}