开发: 删除不用的文件
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import Footer from '@/components/Footer';
|
||||
import { IAjaxReturn, post } from '@/services/ajax';
|
||||
import { getFakeCaptcha } from '@/services/ant-design-pro/login';
|
||||
import {
|
||||
AlipayCircleOutlined,
|
||||
LockOutlined,
|
||||
@@ -16,8 +15,8 @@ import {
|
||||
ProFormText,
|
||||
} 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, App, message, Tabs } from 'antd';
|
||||
import { FormattedMessage, Helmet, history, SelectLang, useModel } from '@umijs/max';
|
||||
import { Alert, App, Tabs } from 'antd';
|
||||
import { stringify as qsStringify } from 'qs';
|
||||
import React, { useState } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
@@ -101,8 +100,6 @@ const Login: React.FC = () => {
|
||||
};
|
||||
});
|
||||
|
||||
const intl = useIntl();
|
||||
|
||||
const fetchUserInfo = async () => {
|
||||
const userInfo = await initialState?.fetchUserInfo?.();
|
||||
if (userInfo) {
|
||||
@@ -148,13 +145,7 @@ const Login: React.FC = () => {
|
||||
return (
|
||||
<div className={containerClassName}>
|
||||
<Helmet>
|
||||
<title>
|
||||
{intl.formatMessage({
|
||||
id: 'menu.login',
|
||||
defaultMessage: '登录页',
|
||||
})}
|
||||
- {Settings.title}
|
||||
</title>
|
||||
<title>登录页 - {Settings.title}</title>
|
||||
</Helmet>
|
||||
{/* <Lang /> */}
|
||||
<div
|
||||
@@ -211,28 +202,17 @@ const Login: React.FC = () => {
|
||||
items={[
|
||||
{
|
||||
key: 'account',
|
||||
label: intl.formatMessage({
|
||||
id: 'pages.login.accountLogin.tab',
|
||||
defaultMessage: '账户密码登录',
|
||||
}),
|
||||
label: '账户密码登录',
|
||||
},
|
||||
// {
|
||||
// key: 'mobile',
|
||||
// label: intl.formatMessage({
|
||||
// id: 'pages.login.phoneLogin.tab',
|
||||
// defaultMessage: '手机号登录',
|
||||
// }),
|
||||
// label: '手机号登录',
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
|
||||
{status === 'error' && loginType === 'account' && (
|
||||
<LoginMessage
|
||||
content={intl.formatMessage({
|
||||
id: 'pages.login.accountLogin.errorMessage',
|
||||
defaultMessage: '账户或密码错误(admin/ant.design)',
|
||||
})}
|
||||
/>
|
||||
<LoginMessage content={'账户或密码错误(admin/ant.design)'} />
|
||||
)}
|
||||
{type === 'account' && (
|
||||
<>
|
||||
@@ -242,10 +222,7 @@ const Login: React.FC = () => {
|
||||
size: 'large',
|
||||
prefix: <UserOutlined />,
|
||||
}}
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'pages.login.username.placeholder',
|
||||
defaultMessage: '用户名: admin or user',
|
||||
})}
|
||||
placeholder={'用户名'}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@@ -264,10 +241,7 @@ const Login: React.FC = () => {
|
||||
size: 'large',
|
||||
prefix: <LockOutlined />,
|
||||
}}
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'pages.login.password.placeholder',
|
||||
defaultMessage: '请输入密码',
|
||||
})}
|
||||
placeholder={'请输入密码'}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@@ -292,10 +266,7 @@ const Login: React.FC = () => {
|
||||
prefix: <MobileOutlined />,
|
||||
}}
|
||||
name="mobile"
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'pages.login.phoneNumber.placeholder',
|
||||
defaultMessage: '手机号',
|
||||
})}
|
||||
placeholder={'手机号'}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@@ -325,21 +296,12 @@ const Login: React.FC = () => {
|
||||
captchaProps={{
|
||||
size: 'large',
|
||||
}}
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'pages.login.captcha.placeholder',
|
||||
defaultMessage: '请输入验证码',
|
||||
})}
|
||||
placeholder={'请输入验证码'}
|
||||
captchaTextRender={(timing, count) => {
|
||||
if (timing) {
|
||||
return `${count} ${intl.formatMessage({
|
||||
id: 'pages.getCaptchaSecondText',
|
||||
defaultMessage: '获取验证码',
|
||||
})}`;
|
||||
return `${count} 获取验证码`;
|
||||
}
|
||||
return intl.formatMessage({
|
||||
id: 'pages.login.phoneLogin.getVerificationCode',
|
||||
defaultMessage: '获取验证码',
|
||||
});
|
||||
return '获取验证码';
|
||||
}}
|
||||
name="captcha"
|
||||
rules={[
|
||||
@@ -354,13 +316,13 @@ const Login: React.FC = () => {
|
||||
},
|
||||
]}
|
||||
onGetCaptcha={async (phone) => {
|
||||
const result = await getFakeCaptcha({
|
||||
phone,
|
||||
});
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
message.success('获取验证码成功!验证码为:1234');
|
||||
// const result = await getFakeCaptcha({
|
||||
// phone,
|
||||
// });
|
||||
// if (!result) {
|
||||
// return;
|
||||
// }
|
||||
// message.success('获取验证码成功!验证码为:1234');
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
|
Reference in New Issue
Block a user