Icônes + CSS et intégration Backend

This commit is contained in:
Angels-dev
2024-08-22 02:37:48 +02:00
parent 81507c7f30
commit 529315354f
49 changed files with 730 additions and 44 deletions

View File

@@ -1,6 +1,4 @@
import { createRouter, createWebHistory } from 'vue-router'
import { inject } from 'vue'
import type { VueCookies } from 'vue-cookies'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -9,6 +7,7 @@ const router = createRouter({
path: '/',
name: 'index',
component: () => import('../views/IndexView.vue'),
meta: { title: 'MainFrame' },
children: [
{
path: '',
@@ -26,7 +25,7 @@ const router = createRouter({
path: '/discord',
name: 'discord',
component: () => import('../views/DiscordView.vue'),
meta: { discordAuth: true },
meta: { title: 'MainFrame | Discord', discordAuth: true },
children: [
{
path: '',
@@ -43,15 +42,9 @@ const router = createRouter({
]
})
router.beforeEach((to) => {
const $cookies = inject<VueCookies>('$cookies')
if (!$cookies) return console.log('Error: $cookies is not injected')
if (to.meta.discordAuth && !$cookies.isKey('DISCORD_CODE')) {
window.location.href =
'https://discord.com/oauth2/authorize?client_id=1274800564449841172&response_type=code&redirect_uri=https%3A%2F%2Fmainframe.zac.ovh%2Fdiscord&scope=identify'
return
}
router.beforeEach((to, from, next) => {
document.title = to.meta.title as string
next()
})
export default router