fix: ignore request errors on setup
This commit is contained in:
+6
-1
@@ -52,7 +52,12 @@ const checkDefaultPage = async (userInfo: any) => {
|
|||||||
const HAS_K8S_CLUSTER_KEY = 'hasKubernetesCluster';
|
const HAS_K8S_CLUSTER_KEY = 'hasKubernetesCluster';
|
||||||
const probeHasKubernetesCluster = async (): Promise<boolean | undefined> => {
|
const probeHasKubernetesCluster = async (): Promise<boolean | undefined> => {
|
||||||
try {
|
try {
|
||||||
const res = await queryClusterList({ page: -1 });
|
const res = await queryClusterList(
|
||||||
|
{ page: -1 },
|
||||||
|
{
|
||||||
|
skipErrorHandler: true
|
||||||
|
}
|
||||||
|
);
|
||||||
const value = (res?.items ?? []).some(
|
const value = (res?.items ?? []).some(
|
||||||
(c) => c?.provider === ProviderValueMap.Kubernetes
|
(c) => c?.provider === ProviderValueMap.Kubernetes
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { request } from '@umijs/max';
|
|||||||
export async function queryCurrentUserState(opts?: Record<string, any>) {
|
export async function queryCurrentUserState(opts?: Record<string, any>) {
|
||||||
return request<Global.UserInfo>(`/users/me`, {
|
return request<Global.UserInfo>(`/users/me`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
skipErrorHandler: true,
|
||||||
...opts
|
...opts
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user