-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.vue
More file actions
46 lines (37 loc) · 904 Bytes
/
app.vue
File metadata and controls
46 lines (37 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<script setup lang="ts">
import { ofetch } from 'ofetch';
const runtimeConfig = useRuntimeConfig();
//Setup ofetch
globalThis.$fetch = ofetch.create({
baseURL: runtimeConfig.public.apiPath as string,
onRequest({ options, request }) {
const cookie = useCookie<string>('token');
if (!cookie.value) return;
// Set the request headers
options.headers = options.headers || {}
options.headers = { ...options.headers, 'Authorization': `Bearer ${cookie.value}` };
},
});
</script>
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<style>
#__nuxt {
@apply p-8 h-full;
}
body {
@apply h-screen bg-gray-800 text-white;
}
input {
@apply rounded-lg px-2 border border-white focus:outline-none focus:border-blue-400 transition-colors bg-transparent;
}
h2 {
@apply text-2xl font-semibold;
}
button {
@apply rounded-lg transition-colors py-1;
}
</style>