增加权限系统

This commit is contained in:
yml2213
2026-05-27 05:41:59 +08:00
parent a04327fd05
commit 1458fc279c
29 changed files with 2276 additions and 46 deletions
+7
View File
@@ -84,6 +84,13 @@ router.beforeEach(async (to) => {
if (!adminSession.token) {
return '/admin/login'
}
if (adminSession.permissions.length === 0) {
try {
await adminSession.loadMe()
} catch {
// 权限加载失败,仍然允许访问(降级为无权限状态)
}
}
}
return true
})