flat: 扫码,未对接
This commit is contained in:
@@ -17,13 +17,14 @@ import {
|
||||
} from '@ant-design/pro-components';
|
||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
||||
import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max';
|
||||
import { Alert, Col, Image, message, Row, Tabs } from 'antd';
|
||||
import { Alert, Col, Image, message, Row, Tabs, QRCode } from 'antd';
|
||||
import Settings from '../../../../config/defaultSettings';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
// flushSync 允许你强制 React 同步刷新提供的回调中的任何更新。这确保了 DOM 立即更新
|
||||
import { clearSessionToken, setSessionToken } from '@/access';
|
||||
import logoImg from '@/assets/logo.svg';
|
||||
import login_imge2b033b1 from '@/assets/login_img.e2b033b1.png';
|
||||
|
||||
const ActionIcons = () => {
|
||||
const langClassName = useEmotionCss(({ token }) => {
|
||||
@@ -92,6 +93,7 @@ const Login: React.FC = () => {
|
||||
const { initialState, setInitialState } = useModel('@@initialState');
|
||||
const [captchaCode, setCaptchaCode] = useState<string>('');
|
||||
const [uuid, setUuid] = useState<string>('');
|
||||
const [qrcodeVal, setQrcodeVal] = useState<string>('7655212');
|
||||
|
||||
const containerClassName = useEmotionCss(() => {
|
||||
return {
|
||||
@@ -192,7 +194,8 @@ const Login: React.FC = () => {
|
||||
minWidth: 280,
|
||||
maxWidth: '75vw',
|
||||
}}
|
||||
logo={<img alt="logo" src={logoImg} />}
|
||||
submitter={type === 'scanQode' ? false : true}
|
||||
// logo={<img alt="logo" src={logoImg} />}
|
||||
title="青岛智慧就业服务系统"
|
||||
// subTitle={intl.formatMessage({ id: 'pages.layouts.userLayout.title' })}
|
||||
initialValues={{
|
||||
@@ -222,6 +225,10 @@ const Login: React.FC = () => {
|
||||
defaultMessage: '账户密码登录',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'scanQode',
|
||||
label: '社保卡扫码登录',
|
||||
},
|
||||
// {
|
||||
// key: 'mobile',
|
||||
// label: intl.formatMessage({
|
||||
@@ -232,7 +239,7 @@ const Login: React.FC = () => {
|
||||
]}
|
||||
/>
|
||||
|
||||
{/*{code !== 200 && loginType === 'account' && (*/}
|
||||
{/* {code !== 200 && loginType === 'account' && ( */}
|
||||
{/* <LoginMessage*/}
|
||||
{/* content={intl.formatMessage({*/}
|
||||
{/* id: 'pages.login.accountLogin.errorMessage',*/}
|
||||
@@ -240,6 +247,23 @@ const Login: React.FC = () => {
|
||||
{/* })}*/}
|
||||
{/* />*/}
|
||||
{/*)}*/}
|
||||
|
||||
{type === 'scanQode' && (
|
||||
<>
|
||||
<Row>
|
||||
<Col offset={1}>
|
||||
<QRCode
|
||||
errorLevel="H"
|
||||
size={300}
|
||||
iconSize={300 / 5}
|
||||
value="https://ant.design/"
|
||||
icon={login_imge2b033b1}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</>
|
||||
)}
|
||||
|
||||
{type === 'account' && (
|
||||
<>
|
||||
<ProFormText
|
||||
@@ -413,22 +437,24 @@ const Login: React.FC = () => {
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div
|
||||
style={{
|
||||
marginBottom: 24,
|
||||
}}
|
||||
>
|
||||
<ProFormCheckbox noStyle name="autoLogin">
|
||||
<FormattedMessage id="pages.login.rememberMe" defaultMessage="自动登录" />
|
||||
</ProFormCheckbox>
|
||||
<a
|
||||
{type !== 'scanQode' && (
|
||||
<div
|
||||
style={{
|
||||
float: 'right',
|
||||
marginBottom: 24,
|
||||
}}
|
||||
>
|
||||
<FormattedMessage id="pages.login.forgotPassword" defaultMessage="忘记密码" />
|
||||
</a>
|
||||
</div>
|
||||
<ProFormCheckbox noStyle name="autoLogin">
|
||||
<FormattedMessage id="pages.login.rememberMe" defaultMessage="自动登录" />
|
||||
</ProFormCheckbox>
|
||||
<a
|
||||
style={{
|
||||
float: 'right',
|
||||
}}
|
||||
>
|
||||
<FormattedMessage id="pages.login.forgotPassword" defaultMessage="忘记密码" />
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</LoginForm>
|
||||
</div>
|
||||
<Footer />
|
||||
|
||||
Reference in New Issue
Block a user