♻️Refactor: OAuth2Callback Page
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { Dimmer, Loader, Segment } from 'semantic-ui-react';
|
import { Spin, Typography, Space } from '@douyinfe/semi-ui';
|
||||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import { API, showError, showSuccess, updateAPI } from '../helpers';
|
import { API, showError, showSuccess, updateAPI } from '../helpers';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../context/User';
|
||||||
@@ -52,11 +52,15 @@ const OAuth2Callback = (props) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Segment style={{ minHeight: '300px' }}>
|
<div className="flex items-center justify-center min-h-[300px] w-full bg-white rounded-lg shadow p-6">
|
||||||
<Dimmer active inverted>
|
<Space vertical align="center">
|
||||||
<Loader size='large'>{prompt}</Loader>
|
<Spin size="large" spinning={processing}>
|
||||||
</Dimmer>
|
<div className="min-h-[200px] min-w-[200px] flex items-center justify-center">
|
||||||
</Segment>
|
<Typography.Text type="secondary">{prompt}</Typography.Text>
|
||||||
|
</div>
|
||||||
|
</Spin>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -95,14 +95,14 @@ const Home = () => {
|
|||||||
{/* 操作按钮 */}
|
{/* 操作按钮 */}
|
||||||
<div className="mt-6 md:mt-10 flex flex-wrap gap-4 justify-center md:justify-start">
|
<div className="mt-6 md:mt-10 flex flex-wrap gap-4 justify-center md:justify-start">
|
||||||
<Link to="/console">
|
<Link to="/console">
|
||||||
<Button theme="solid" type="primary" size="large">
|
<Button theme="solid" type="primary" size="large" className="!rounded-3xl">
|
||||||
{t('开始使用')}
|
{t('开始使用')}
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
{isDemoSiteMode && (
|
{isDemoSiteMode && (
|
||||||
<Button
|
<Button
|
||||||
size="large"
|
size="large"
|
||||||
className="flex items-center"
|
className="flex items-center !rounded-3xl"
|
||||||
icon={<IconGithubLogo />}
|
icon={<IconGithubLogo />}
|
||||||
onClick={() => window.open('https://github.com/QuantumNous/new-api', '_blank')}
|
onClick={() => window.open('https://github.com/QuantumNous/new-api', '_blank')}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user