perf: hide anonymousUser in user management list (#844)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

在用户管理列表隐藏 anonymousUser 用户,anonymousUser 暂时没有实际用途。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2775#issuecomment-1425129852

#### Screenshots:

<img width="1410" alt="image" src="https://user-images.githubusercontent.com/21301288/217997078-5e2e0724-5f22-45dc-a9c6-ee42254c9bd7.png">


#### Special notes for your reviewer:

测试方式:

1. 进入 Console 的用户管理,检查是否有名为 Anonymous User 的用户即可。

#### Does this PR introduce a user-facing change?

```release-note
在 Console 端的用户管理中隐藏 `Anonymous User` 用户。
```
pull/847/head
Ryan Wang 2023-02-10 12:32:15 +08:00 committed by GitHub
parent 3724a45889
commit 7320aa1592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,8 @@ const userStore = useUserStore();
let fuse: Fuse<User> | undefined = undefined; let fuse: Fuse<User> | undefined = undefined;
const ANONYMOUSUSER_NAME = "anonymousUser";
const handleFetchUsers = async (options?: { mute?: boolean }) => { const handleFetchUsers = async (options?: { mute?: boolean }) => {
try { try {
clearInterval(refreshInterval.value); clearInterval(refreshInterval.value);
@ -69,6 +71,7 @@ const handleFetchUsers = async (options?: { mute?: boolean }) => {
const { data } = await apiClient.extension.user.listv1alpha1User({ const { data } = await apiClient.extension.user.listv1alpha1User({
page: users.value.page, page: users.value.page,
size: users.value.size, size: users.value.size,
fieldSelector: [`name!=${ANONYMOUSUSER_NAME}`],
}); });
users.value = data; users.value = data;