perf: hide anonymousUser in user filter dropdown list (#891)

#### What type of PR is this?

/kind improvement

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

在用户条件筛选框中隐藏匿名用户。

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

Fixes https://github.com/halo-dev/halo/issues/3407

#### Screenshots:

<img width="864" alt="image" src="https://user-images.githubusercontent.com/21301288/221490795-eaf9c515-e487-4d76-87dd-f0010415360e.png">

#### Special notes for your reviewer:

None

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

```release-note
None
```
pull/892/head^2
Ryan Wang 2023-02-28 22:54:18 +08:00 committed by GitHub
parent 3d718b57b4
commit 0a65f5bd14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -17,10 +17,14 @@ export function useUserFetch(options?: {
const users = ref<User[]>([] as User[]);
const loading = ref(false);
const ANONYMOUSUSER_NAME = "anonymousUser";
const handleFetchUsers = async () => {
try {
loading.value = true;
const { data } = await apiClient.extension.user.listv1alpha1User();
const { data } = await apiClient.extension.user.listv1alpha1User({
fieldSelector: [`name!=${ANONYMOUSUSER_NAME}`],
});
users.value = data.items;
} catch (e) {
console.error("Failed to fetch users", e);