mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
fix(auth): sign up page not found when entering with url directly (#4002)
This commit is contained in:
parent
0bb5d5f5ee
commit
f12952de1f
@ -3,11 +3,16 @@ import React from 'react';
|
|||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
import { useSystemSettings, PoweredBy, useRequest, useAPIClient } from '@nocobase/client';
|
import { useSystemSettings, PoweredBy, useRequest, useAPIClient } from '@nocobase/client';
|
||||||
import { AuthenticatorsContext } from '../authenticator';
|
import { AuthenticatorsContext } from '../authenticator';
|
||||||
|
import { Spin } from 'antd';
|
||||||
|
|
||||||
export function AuthLayout(props: any) {
|
export function AuthLayout(props: any) {
|
||||||
const { data } = useSystemSettings();
|
const { data } = useSystemSettings();
|
||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
const { data: authenticators = [], error } = useRequest(() =>
|
const {
|
||||||
|
data: authenticators = [],
|
||||||
|
error,
|
||||||
|
loading,
|
||||||
|
} = useRequest(() =>
|
||||||
api
|
api
|
||||||
.resource('authenticators')
|
.resource('authenticators')
|
||||||
.publicList()
|
.publicList()
|
||||||
@ -16,6 +21,10 @@ export function AuthLayout(props: any) {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return <Spin />;
|
||||||
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user