From 0735db284624c9b2767260184c51c7f9f028f7a4 Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Thu, 20 Jul 2017 10:28:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4login=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=B0=8F=E5=86=99=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/containers/Login/Login-wrap.js | 40 --------- client/containers/Login/Login.js | 73 --------------- client/containers/Login/Login.scss | 4 - client/containers/Login/Reg.js | 124 -------------------------- client/containers/Login/login-wrap.js | 40 --------- client/containers/Login/login.js | 73 --------------- client/containers/Login/login.scss | 4 - client/containers/Login/reg.js | 124 -------------------------- 8 files changed, 482 deletions(-) delete mode 100644 client/containers/Login/Login-wrap.js delete mode 100644 client/containers/Login/Login.js delete mode 100644 client/containers/Login/Login.scss delete mode 100644 client/containers/Login/Reg.js delete mode 100644 client/containers/Login/login-wrap.js delete mode 100644 client/containers/Login/login.js delete mode 100644 client/containers/Login/login.scss delete mode 100644 client/containers/Login/reg.js diff --git a/client/containers/Login/Login-wrap.js b/client/containers/Login/Login-wrap.js deleted file mode 100644 index eabaa709..00000000 --- a/client/containers/Login/Login-wrap.js +++ /dev/null @@ -1,40 +0,0 @@ -import './Login.scss' -import React, { Component } from 'react' -import { connect } from 'react-redux' -import PropTypes from 'prop-types' -import { Tabs } from 'antd'; -import LoginForm from './Login'; -import RegForm from './Reg'; -const TabPane = Tabs.TabPane; - - -class LoginWrap extends Component { - constructor(props){ - super(props); - } - - static propTypes = { - form: PropTypes.object, - loginWrapActiveKey:PropTypes.string - } - - render() { - const { loginWrapActiveKey } = this.props; - return ( - - - - - - - - - ); - } -} - -export default connect( - state =>({ - loginWrapActiveKey: state.login.loginWrapActiveKey - }) -)(LoginWrap) diff --git a/client/containers/Login/Login.js b/client/containers/Login/Login.js deleted file mode 100644 index 6e1d5846..00000000 --- a/client/containers/Login/Login.js +++ /dev/null @@ -1,73 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { Form, Button, Input, Icon, Checkbox } from 'antd'; -import { loginActions } from '../../actions/login'; -const FormItem = Form.Item; -@connect( - state => { - return { - loginData: state.login - } - }, - { - loginActions - } -) - -class Login extends Component { - constructor(props) { - super(props) - } - - static propTypes = { - form: PropTypes.object, - loginActions: PropTypes.func - } - - handleSubmit = (e) => { - e.preventDefault(); - const form = this.props.form; - form.validateFields((err, values) => { - if (!err) { - this.props.loginActions(values); - } - }); - } - - render() { - const { getFieldDecorator } = this.props.form; - const that = this; - return ( -
- - {/* 用户名 (Email) */} - - {getFieldDecorator('email', { - rules: [{ required: true, message: '请输入email!' }] - })( - } placeholder="Email" /> - )} - - - {/* 密码 */} - - {getFieldDecorator('password', { - rules: [{ required: true, message: '请输入密码!' }] - })( - } type="password" placeholder="Password" /> - )} - - - - {/* 登录按钮 */} - - - - -
- ) - } -} -const LoginForm = Form.create()(Login); -export default LoginForm; diff --git a/client/containers/Login/Login.scss b/client/containers/Login/Login.scss deleted file mode 100644 index 8768f1e5..00000000 --- a/client/containers/Login/Login.scss +++ /dev/null @@ -1,4 +0,0 @@ -@import '../../styles/common.scss'; - -/* .login-main.css */ - diff --git a/client/containers/Login/Reg.js b/client/containers/Login/Reg.js deleted file mode 100644 index d95f6287..00000000 --- a/client/containers/Login/Reg.js +++ /dev/null @@ -1,124 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { Form, Button, Input, Icon } from 'antd'; -import { regActions } from '../../actions/login'; - -const FormItem = Form.Item; -@connect( - state => { - return { - loginData: state.login - } - }, - { - regActions - } -) - -class Reg extends Component { - constructor(props) { - super(props); - this.state = { - confirmDirty: false - } - } - - static propTypes = { - form: PropTypes.object, - regActions: PropTypes.func - } - - handleSubmit = (e) => { - e.preventDefault(); - const form = this.props.form; - form.validateFieldsAndScroll((err, values) => { - if (!err) { - this.props.regActions(values); - } - }); - } - - handleConfirmBlur = (e) => { - const value = e.target.value; - this.setState({ confirmDirty: this.state.confirmDirty || !!value }); - } - - checkPassword = (rule, value, callback) => { - const form = this.props.form; - if (value && value !== form.getFieldValue('password')) { - callback('Two passwords that you enter is inconsistent!'); - } else { - callback(); - } - } - - checkConfirm = (rule, value, callback) => { - const form = this.props.form; - if (value && this.state.confirmDirty) { - form.validateFields(['confirm'], { force: true }); - } - callback(); - } - - render() { - const { getFieldDecorator } = this.props.form; - return ( -
- - {/* 用户名 */} - - {getFieldDecorator('userName', { - rules: [{ required: true, message: '请输入用户名!' }] - })( - } placeholder="Username" /> - )} - - - {/* Emaiil */} - - {getFieldDecorator('email', { - rules: [{ required: true, message: '请输入email!' }] - })( - } placeholder="Email" /> - )} - - - {/* 密码 */} - - {getFieldDecorator('password', { - rules: [{ - required: true, - message: '请输入密码!' - }, { - validator: this.checkConfirm - }] - })( - } type="password" placeholder="Password" /> - )} - - - {/* 密码二次确认 */} - - {getFieldDecorator('confirm', { - rules: [{ - required: true, - message: '请再次输入密码密码!' - }, { - validator: this.checkPassword - }] - })( - } type="password" placeholder="Confirm Password" /> - )} - - - {/* 注册按钮 */} - - - -
- ) - } -} -const RegForm = Form.create()(Reg); -export default RegForm; diff --git a/client/containers/Login/login-wrap.js b/client/containers/Login/login-wrap.js deleted file mode 100644 index eabaa709..00000000 --- a/client/containers/Login/login-wrap.js +++ /dev/null @@ -1,40 +0,0 @@ -import './Login.scss' -import React, { Component } from 'react' -import { connect } from 'react-redux' -import PropTypes from 'prop-types' -import { Tabs } from 'antd'; -import LoginForm from './Login'; -import RegForm from './Reg'; -const TabPane = Tabs.TabPane; - - -class LoginWrap extends Component { - constructor(props){ - super(props); - } - - static propTypes = { - form: PropTypes.object, - loginWrapActiveKey:PropTypes.string - } - - render() { - const { loginWrapActiveKey } = this.props; - return ( - - - - - - - - - ); - } -} - -export default connect( - state =>({ - loginWrapActiveKey: state.login.loginWrapActiveKey - }) -)(LoginWrap) diff --git a/client/containers/Login/login.js b/client/containers/Login/login.js deleted file mode 100644 index 6e1d5846..00000000 --- a/client/containers/Login/login.js +++ /dev/null @@ -1,73 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { Form, Button, Input, Icon, Checkbox } from 'antd'; -import { loginActions } from '../../actions/login'; -const FormItem = Form.Item; -@connect( - state => { - return { - loginData: state.login - } - }, - { - loginActions - } -) - -class Login extends Component { - constructor(props) { - super(props) - } - - static propTypes = { - form: PropTypes.object, - loginActions: PropTypes.func - } - - handleSubmit = (e) => { - e.preventDefault(); - const form = this.props.form; - form.validateFields((err, values) => { - if (!err) { - this.props.loginActions(values); - } - }); - } - - render() { - const { getFieldDecorator } = this.props.form; - const that = this; - return ( -
- - {/* 用户名 (Email) */} - - {getFieldDecorator('email', { - rules: [{ required: true, message: '请输入email!' }] - })( - } placeholder="Email" /> - )} - - - {/* 密码 */} - - {getFieldDecorator('password', { - rules: [{ required: true, message: '请输入密码!' }] - })( - } type="password" placeholder="Password" /> - )} - - - - {/* 登录按钮 */} - - - - -
- ) - } -} -const LoginForm = Form.create()(Login); -export default LoginForm; diff --git a/client/containers/Login/login.scss b/client/containers/Login/login.scss deleted file mode 100644 index 8768f1e5..00000000 --- a/client/containers/Login/login.scss +++ /dev/null @@ -1,4 +0,0 @@ -@import '../../styles/common.scss'; - -/* .login-main.css */ - diff --git a/client/containers/Login/reg.js b/client/containers/Login/reg.js deleted file mode 100644 index d95f6287..00000000 --- a/client/containers/Login/reg.js +++ /dev/null @@ -1,124 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { Form, Button, Input, Icon } from 'antd'; -import { regActions } from '../../actions/login'; - -const FormItem = Form.Item; -@connect( - state => { - return { - loginData: state.login - } - }, - { - regActions - } -) - -class Reg extends Component { - constructor(props) { - super(props); - this.state = { - confirmDirty: false - } - } - - static propTypes = { - form: PropTypes.object, - regActions: PropTypes.func - } - - handleSubmit = (e) => { - e.preventDefault(); - const form = this.props.form; - form.validateFieldsAndScroll((err, values) => { - if (!err) { - this.props.regActions(values); - } - }); - } - - handleConfirmBlur = (e) => { - const value = e.target.value; - this.setState({ confirmDirty: this.state.confirmDirty || !!value }); - } - - checkPassword = (rule, value, callback) => { - const form = this.props.form; - if (value && value !== form.getFieldValue('password')) { - callback('Two passwords that you enter is inconsistent!'); - } else { - callback(); - } - } - - checkConfirm = (rule, value, callback) => { - const form = this.props.form; - if (value && this.state.confirmDirty) { - form.validateFields(['confirm'], { force: true }); - } - callback(); - } - - render() { - const { getFieldDecorator } = this.props.form; - return ( -
- - {/* 用户名 */} - - {getFieldDecorator('userName', { - rules: [{ required: true, message: '请输入用户名!' }] - })( - } placeholder="Username" /> - )} - - - {/* Emaiil */} - - {getFieldDecorator('email', { - rules: [{ required: true, message: '请输入email!' }] - })( - } placeholder="Email" /> - )} - - - {/* 密码 */} - - {getFieldDecorator('password', { - rules: [{ - required: true, - message: '请输入密码!' - }, { - validator: this.checkConfirm - }] - })( - } type="password" placeholder="Password" /> - )} - - - {/* 密码二次确认 */} - - {getFieldDecorator('confirm', { - rules: [{ - required: true, - message: '请再次输入密码密码!' - }, { - validator: this.checkPassword - }] - })( - } type="password" placeholder="Confirm Password" /> - )} - - - {/* 注册按钮 */} - - - -
- ) - } -} -const RegForm = Form.create()(Reg); -export default RegForm;