This commit is contained in:
2023-10-16 11:27:37 +08:00
parent 826f99350c
commit b5b55dc3b2
29 changed files with 951 additions and 319 deletions

View File

@@ -6,6 +6,7 @@ import { useLocalStorage } from '@vueuse/core'
import { createDiscreteApi } from 'naive-ui'
export const ACCOUNT = ref<AccountInfo>()
export const isLoadingAccount = ref(true)
const { message } = createDiscreteApi(['message'])
const cookie = useLocalStorage('JWT_Token', '')
@@ -15,6 +16,7 @@ export async function GetSelfAccount() {
const result = await Self()
if (result.code == 200) {
ACCOUNT.value = result.data
isLoadingAccount.value = false
console.log('[vtsuru] 已获取账户信息')
return result.data
} else if (result.code == 401) {
@@ -27,6 +29,7 @@ export async function GetSelfAccount() {
message.error(result.message)
}
}
isLoadingAccount.value = false
}
export function useAccount() {
return ACCOUNT