more typescript changes/conversion nonsense (this broke a lot of stuff)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<script setup>
|
<script setup lang="ts">
|
||||||
import { RouterLink, RouterView } from 'vue-router';
|
import { RouterLink, RouterView } from 'vue-router';
|
||||||
import Separator from './components/ui/separator/Separator.vue';
|
import Separator from './components/ui/separator/Separator.vue';
|
||||||
import Button from './components/ui/button/Button.vue';
|
import Button from './components/ui/button/Button.vue';
|
||||||
@@ -14,7 +14,7 @@ import { useUserStore } from './stores/user';
|
|||||||
import Alert from './components/ui/alert/Alert.vue';
|
import Alert from './components/ui/alert/Alert.vue';
|
||||||
import AlertDescription from './components/ui/alert/AlertDescription.vue';
|
import AlertDescription from './components/ui/alert/AlertDescription.vue';
|
||||||
|
|
||||||
const userStore = useUserStore();
|
let userStore = useUserStore();
|
||||||
|
|
||||||
// onMounted(async () => {
|
// onMounted(async () => {
|
||||||
// const res = await fetch(`${import.meta.env.VITE_APIHOST}/members/me`, {
|
// const res = await fetch(`${import.meta.env.VITE_APIHOST}/members/me`, {
|
||||||
@@ -96,7 +96,7 @@ function formatDate(dateStr) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<DropdownMenu v-if="userStore.isLoggedIn">
|
<DropdownMenu v-if="userStore?.isLoggedIn">
|
||||||
<DropdownMenuTrigger class="cursor-pointer">
|
<DropdownMenuTrigger class="cursor-pointer">
|
||||||
<p>{{ userStore.user.name }}</p>
|
<p>{{ userStore.user.name }}</p>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
@@ -116,7 +116,7 @@ function formatDate(dateStr) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Separator></Separator>
|
<Separator></Separator>
|
||||||
<Alert v-if="userStore.user?.loa?.[0]" class="m-2 mx-auto w-5xl" variant="info">
|
<Alert v-if="userStore?.user?.loa?.[0]" class="m-2 mx-auto w-5xl" variant="info">
|
||||||
<AlertDescription class="flex flex-row items-center text-nowrap gap-5 mx-auto">
|
<AlertDescription class="flex flex-row items-center text-nowrap gap-5 mx-auto">
|
||||||
<p>You are on LOA until <strong>{{ formatDate(userStore.user?.loa?.[0].end_date) }}</strong></p>
|
<p>You are on LOA until <strong>{{ formatDate(userStore.user?.loa?.[0].end_date) }}</strong></p>
|
||||||
<Button variant="secondary">End LOA</Button>
|
<Button variant="secondary">End LOA</Button>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { createApp } from 'vue'
|
|||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router/index'
|
||||||
import FormCheckbox from './components/form/FormCheckbox.vue'
|
import FormCheckbox from './components/form/FormCheckbox.vue'
|
||||||
import FormInput from './components/form/FormInput.vue'
|
import FormInput from './components/form/FormInput.vue'
|
||||||
|
|
||||||
@@ -47,12 +47,12 @@ router.beforeEach(async (to) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Not logged in
|
// Not logged in
|
||||||
if (to.meta.requiresAuth && !user.isLoggedIn) {
|
// if (to.meta.requiresAuth && !user.isLoggedIn) {
|
||||||
// Redirect back to original page after login
|
// // Redirect back to original page after login
|
||||||
const redirectUrl = encodeURIComponent(window.location.origin + to.fullPath)
|
// const redirectUrl = encodeURIComponent(window.location.origin + to.fullPath)
|
||||||
window.location.href = `https://aj17thdevapi.nexuszone.net/login?redirect=${redirectUrl}`
|
// window.location.href = `https://aj17thdevapi.nexuszone.net/login?redirect=${redirectUrl}`
|
||||||
return false // Prevent Vue Router from continuing
|
// return false // Prevent Vue Router from continuing
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// // Must be a member
|
// // Must be a member
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"types": ["vite/client"],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"],
|
"@/*": ["./src/*"],
|
||||||
"@shared/*": ["../shared/*"]
|
"@shared/*": ["../shared/*"]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
import path from 'node:path'
|
||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
@@ -15,7 +16,8 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
'@shared': path.resolve(__dirname, '../shared/*')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
Reference in New Issue
Block a user