Merge remote-tracking branch 'origin/master'

pull/59/head
shao1121353141 2023-09-26 22:17:38 +08:00
commit 2a0407994d
10 changed files with 257 additions and 273 deletions

View File

@ -13,7 +13,7 @@
-------------------------- --------------------------
<div align="center">⭐️ 如果你喜欢 TopIAM请给它一个 Star您的支持将是我们前行的动力。</div> <div align="center">⭐️ 如果你喜欢 TOPIAM请给它一个 Star您的支持将是我们前行的动力。</div>
-------------------------- --------------------------

View File

@ -68,7 +68,7 @@ export async function getInitialState(): Promise<{
/** /**
* *
*/ */
console.log('%c欢迎使用 TopIAM 企业数字身份管控平台', 'font-size: 24px;'); console.log('%c欢迎使用 TOPIAM 企业数字身份管控平台', 'font-size: 24px;');
return { return {
fetchUserInfo, fetchUserInfo,
currentUser: isLoginPath() ? undefined : await fetchUserInfo(), currentUser: isLoginPath() ? undefined : await fetchUserInfo(),

View File

@ -22,7 +22,7 @@ import Marquee from 'react-fast-marquee';
const message = () => { const message = () => {
return ( return (
<> <>
<span> TopIAM Star </span> <span> TOPIAM Star </span>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/topiam/eiam"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/topiam/eiam">
GitHub GitHub
</a> </a>

View File

@ -121,7 +121,7 @@ const Welcome: React.FC = () => {
color: '#1A1A1A', color: '#1A1A1A',
}} }}
> >
使 TopIAM 使 TOPIAM
</div> </div>
<p <p
style={{ style={{

View File

@ -22,7 +22,7 @@ import Marquee from 'react-fast-marquee';
const message = () => { const message = () => {
return ( return (
<> <>
<span> TopIAM Star </span> <span> TOPIAM Star </span>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/topiam/eiam"> <a target="_blank" rel="noopener noreferrer" href="https://github.com/topiam/eiam">
GitHub GitHub
</a> </a>

View File

@ -24,7 +24,7 @@ const currentYear = new Date().getFullYear();
export default (props: FooterProps) => ( export default (props: FooterProps) => (
<DefaultFooter <DefaultFooter
style={{ backgroundColor: 'transparent' }} style={{ backgroundColor: 'transparent' }}
copyright={`2020-${currentYear} TopIAM 版权所有`} copyright={`2022-${currentYear} TOPIAM 版权所有`}
links={[ links={[
{ {
key: 'website', key: 'website',

View File

@ -20,9 +20,9 @@ import { ICON_LIST } from '@/components/IconFont/constant';
import { IDP_TYPE, RESULT_STATE, SESSION_STATUS } from '@/constants'; import { IDP_TYPE, RESULT_STATE, SESSION_STATUS } from '@/constants';
import { getCurrentStatus, getLoginEncryptSecret } from '@/services'; import { getCurrentStatus, getLoginEncryptSecret } from '@/services';
import { aesEcbEncrypt } from '@/utils/aes'; import { aesEcbEncrypt } from '@/utils/aes';
import { ProCard, ProForm, ProFormCheckbox, ProFormInstance } from '@ant-design/pro-components'; import { ProForm, ProFormCheckbox, ProFormInstance } from '@ant-design/pro-components';
import { useAsyncEffect, useRequest, useSafeState } from 'ahooks'; import { useAsyncEffect, useRequest, useSafeState } from 'ahooks';
import { Alert, App, Avatar, Skeleton, Space, Spin, Tabs, Tooltip } from 'antd'; import { Alert, App, Avatar, Space, Spin, Tabs, Tooltip } from 'antd';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
import { useRef, useState } from 'react'; import { useRef, useState } from 'react';
import { FormattedMessage, Helmet, history, useIntl } from '@umijs/max'; import { FormattedMessage, Helmet, history, useIntl } from '@umijs/max';
@ -36,12 +36,11 @@ import { accountLogin, getLoginConfig, otpLogin } from './service';
import useStyle from './style'; import useStyle from './style';
import { goto } from './utils'; import { goto } from './utils';
import queryString from 'query-string'; import queryString from 'query-string';
import Banner from '@/components/Banner';
import { omit } from 'lodash'; import { omit } from 'lodash';
import { emailValidator } from '@/utils/utils'; import { emailValidator } from '@/utils/utils';
import PageLoading from '@/components/PageLoading';
const prefixCls = 'topiam-login'; const prefixCls = 'topiam-login';
const showBanner = process.env.PREVIEW_ENV || process.env.NODE_ENV === 'development';
/** /**
* *
@ -313,20 +312,12 @@ const Login = () => {
<Helmet> <Helmet>
<link rel="icon" href={'/favicon.ico'} /> <link rel="icon" href={'/favicon.ico'} />
</Helmet> </Helmet>
{showBanner && ( {statusLoading || loginConfigLoading ? (
<div className={`${prefixCls}-banner`}> <PageLoading />
<Banner /> ) : (
</div>
)}
<div className={`${prefixCls}-container`}> <div className={`${prefixCls}-container`}>
<div className={`${prefixCls}-content`}> <div className={`${prefixCls}-content`}>
<div className={`${prefixCls}-card`}> <div className={`${prefixCls}-card`}>
{statusLoading ? (
<ProCard>
<Skeleton loading={statusLoading} paragraph={{ rows: 5 }}></Skeleton>
</ProCard>
) : (
<>
{/*登录*/} {/*登录*/}
{!status && !forgetPassword && ( {!status && !forgetPassword && (
<> <>
@ -340,9 +331,7 @@ const Login = () => {
{/*登录错误*/} {/*登录错误*/}
{userLoginState?.status !== RESULT_STATE.SUCCESS && {userLoginState?.status !== RESULT_STATE.SUCCESS &&
currentProvider?.type === IDP_TYPE.ACCOUNT && currentProvider?.type === IDP_TYPE.ACCOUNT &&
userLoginState?.message && ( userLoginState?.message && <LoginMessage content={userLoginState?.message} />}
<LoginMessage content={userLoginState?.message} />
)}
{/*其他登录方式*/} {/*其他登录方式*/}
{loginConfig?.idps?.map((value) => { {loginConfig?.idps?.map((value) => {
if ( if (
@ -395,7 +384,7 @@ const Login = () => {
}, },
}} }}
onFinish={async (values) => { onFinish={async (values) => {
await run(values); run(values);
return data; return data;
}} }}
> >
@ -584,13 +573,12 @@ const Login = () => {
}} }}
/> />
)} )}
</>
)}
</div> </div>
</div> </div>
{/**Footer*/} {/**Footer*/}
<Footer className={`${prefixCls}-footer`} /> <Footer className={`${prefixCls}-footer`} />
</div> </div>
)}
</div> </div>
); );
}; };

View File

@ -21,8 +21,7 @@ const useStyle = createStyles((_, props) => {
const prefixCls = `${props}`; const prefixCls = `${props}`;
return { return {
main: { main: {
width: '320px', width: '328px',
marginTop: '24px',
[`.${prefixCls}`]: { [`.${prefixCls}`]: {
['&-success-box']: { ['&-success-box']: {
padding: '40px', padding: '40px',
@ -51,7 +50,6 @@ const useStyle = createStyles((_, props) => {
['&-back']: { ['&-back']: {
width: '100%', width: '100%',
marginBottom: '24px', marginBottom: '24px',
marginTop: '24px',
}, },
['&-back-time']: { ['&-back-time']: {
display: 'flex', display: 'flex',

View File

@ -38,12 +38,11 @@ const useStyle = createStyles(({ prefixCls, token }, props) => {
display: 'flex', display: 'flex',
flex: 'none !important', flex: 'none !important',
flexDirection: 'column', flexDirection: 'column',
width: '430px', padding: '32px',
maxWidth: '100%', maxWidth: '100%',
minHeight: '475px',
backgroundColor: '#fff', backgroundColor: '#fff',
borderRadius: token.borderRadius, borderRadius: token.borderRadius,
boxShadow: '0 2px 10px 0 rgb(57 106 255 / 5%)', boxShadow: '0px 0px 24px 0px rgba(0,0,0,0.1)',
[`${antCls}-tabs-nav-list`]: { [`${antCls}-tabs-nav-list`]: {
margin: 'auto', margin: 'auto',
fontSize: '16px', fontSize: '16px',
@ -57,7 +56,6 @@ const useStyle = createStyles(({ prefixCls, token }, props) => {
}, },
['&-top']: { ['&-top']: {
textAlign: 'center', textAlign: 'center',
padding: '39px 0 0',
}, },
['&-logo']: { ['&-logo']: {
width: '200px', width: '200px',
@ -68,7 +66,7 @@ const useStyle = createStyles(({ prefixCls, token }, props) => {
verticalAlign: 'top', verticalAlign: 'top',
}, },
['&-desc']: { ['&-desc']: {
marginTop: '12px', marginTop: '25px',
marginBottom: '15px', marginBottom: '15px',
color: token.colorTextSecondary, color: token.colorTextSecondary,
fontSize: token.fontSize, fontSize: token.fontSize,

View File

@ -24,7 +24,7 @@ const Workplace: FC = () => {
return ( return (
<PageContainer> <PageContainer>
<Card> <Card>
<Alert banner description={'欢迎使用 TopIAM 企业数字身份管控平台'} type={'success'} /> <Alert banner description={'欢迎使用 TOPIAM 企业数字身份管控平台'} type={'success'} />
</Card> </Card>
</PageContainer> </PageContainer>
); );