feat: add ADMIN_USER_ROLE for user access admin panel (#363)

This commit is contained in:
Dream Hunter
2024-07-27 22:04:18 +08:00
committed by GitHub
parent a0805bc0ce
commit 5faae8796d
21 changed files with 81 additions and 56 deletions

View File

@@ -17,8 +17,8 @@ import { getRouterPathWithLang } from '../utils'
const message = useMessage()
const {
toggleDark, isDark, isTelegram,
showAuth, adminAuth, auth, loading, openSettings
toggleDark, isDark, isTelegram, showAdminPage,
showAuth, auth, loading, openSettings
} = useGlobalState()
const route = useRoute()
const router = useRouter()
@@ -134,7 +134,7 @@ const menuOptions = computed(() => [
icon: () => h(NIcon, { component: AdminPanelSettingsFilled }),
}
),
show: !!adminAuth.value,
show: showAdminPage.value,
key: "admin"
},
{
@@ -223,6 +223,11 @@ const logoClick = async () => {
onMounted(async () => {
await api.getOpenSettings(message);
try {
await api.getUserSettings(message);
} catch (error) {
console.error(error);
}
});
</script>