minor cleanup
This commit is contained in:
@@ -20,16 +20,14 @@
|
||||
<style></style>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, defineEmits } from 'vue'
|
||||
import { Form } from '@primevue/forms'
|
||||
import InputText from 'primevue/inputtext'
|
||||
import Button from 'primevue/button'
|
||||
import Password from 'primevue/password'
|
||||
import axios from 'axios'
|
||||
import { useUserData, login, logout, resetPassword } from './user'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'onAction')
|
||||
(e: 'onAction'): void
|
||||
}>()
|
||||
|
||||
const userData = useUserData()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import axios from 'axios'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
export interface User {
|
||||
username: string
|
||||
@@ -7,7 +8,7 @@ export interface User {
|
||||
authenticated: boolean
|
||||
}
|
||||
|
||||
const $current_user = ref({ username: 'username', is_admin: false, authenticated: false })
|
||||
const $current_user = ref({ id: 0, username: 'username', is_admin: false, authenticated: false })
|
||||
export const current_user = computed((): User => {
|
||||
return $current_user.value
|
||||
})
|
||||
@@ -18,7 +19,7 @@ function loadCurrentUser(): void {
|
||||
})
|
||||
}
|
||||
|
||||
export function useUserData(): void {
|
||||
export function useUserData(): Ref<User> {
|
||||
onMounted(() => {
|
||||
loadCurrentUser()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user