fix: add error handling to AdminPage loadUsers on mount
This commit is contained in:
@@ -14,7 +14,11 @@ const error = ref('')
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
async function loadUsers(): Promise<void> {
|
async function loadUsers(): Promise<void> {
|
||||||
users.value = await authedFetch<UserSummary[]>('/api/admin/users')
|
try {
|
||||||
|
users.value = await authedFetch<UserSummary[]>('/api/admin/users')
|
||||||
|
} catch (e) {
|
||||||
|
error.value = e instanceof Error ? e.message : '加载用户失败'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createUser(): Promise<void> {
|
async function createUser(): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user