update
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import { ref } from "vue";
|
||||
import { ref } from "vue"
|
||||
|
||||
export const loginModal = ref(false)
|
||||
export const loginModal = ref(false)
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
import { computed, ref } from "vue"
|
||||
import { computed, reactive } from "vue"
|
||||
import { Role } from "../utils/type"
|
||||
|
||||
export const username = ref("")
|
||||
export const authed = computed(() => !!username.value)
|
||||
export const user = reactive({
|
||||
loaded: false,
|
||||
username: "",
|
||||
role: Role.Normal,
|
||||
})
|
||||
export const authed = computed(() => !!user.username)
|
||||
export const roleNormal = computed(() => user.role === Role.Normal)
|
||||
export const roleAdmin = computed(() => user.role === Role.Admin)
|
||||
export const roleSuper = computed(() => user.role !== Role.Super)
|
||||
|
||||
Reference in New Issue
Block a user