feat: 注册页面和管理员登录时新用户审核提醒

This commit is contained in:
2025-02-20 19:29:29 +08:00
parent 859aba64a8
commit 6586872327
5 changed files with 262 additions and 7 deletions

View File

@@ -76,6 +76,62 @@ const items = [
const open_login_modal = () => {
modal.open(ModalAuthentication)
}
onMounted(async () => {
if (loginState.user.auth_code === 2) {
/** Adminstrator notifications */
// Fetch unverified users
const unverifiedUsers = await useFetchWrapped<
req.user.UserList & AuthedRequest,
BaseResponse<PagedData<UserSchema>>
>('App.User_User.ListUser', {
token: loginState.token!,
user_id: loginState.user.id!,
page: 1,
perpage: 20,
is_verify: false,
})
if (!unverifiedUsers) {
toast.add({
title: '获取待审核用户失败',
description: '获取未审核用户列表失败',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
} else if (unverifiedUsers.data.total > 0) {
toast.add({
title: '有新用户等待审核',
description: `${unverifiedUsers.data.total} 个新用户注册,请尽快审核`,
color: 'amber',
icon: 'i-tabler-user-plus',
timeout: 0,
actions: [
{
label: '前往处理',
variant: 'solid',
color: 'amber',
click: () => {
router.push({
path: '/generation/admin/users',
query: {
unverified: 1,
},
})
},
},
// {
// label: '全部忽略',
// click: () => {
// alert('ignored')
// },
// },
],
})
}
}
})
</script>
<template>