mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-07 08:30:51 +08:00
feat: add ADMIN_USER_ROLE for user access admin panel (#363)
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user