Commit aff2d076 by zhanghaozhe

引入验证码

parent a90316df
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8"/>
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"/>
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no" content="width=device-width, initial-scale=1, shrink-to-fit=no"
/> />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000"/>
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json"/>
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
...@@ -23,19 +23,40 @@ ...@@ -23,19 +23,40 @@
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>React App</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!-- <!--
This HTML file is a template. This HTML file is a template.
If you open it directly in the browser, you will see an empty page. If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file. You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag. The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script>
var url = 'https://cstaticdun.126.net/load.min.js' + '?t=' + getTimestamp(60 * 1000)
loadScript(url)
function getTimestamp(msec) {
msec = !msec && msec !== 0 ? msec : 1
return parseInt((new Date()).valueOf() / msec, 10)
}
function loadScript(src) {
var head = document.head || document.getElementsByTagName('head')[0]
var script = document.createElement('script')
script.type = 'text/javascript'
script.src = src
head.appendChild(script)
}
</script>
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html> </html>
...@@ -12,7 +12,7 @@ import Input from '../common/Input' ...@@ -12,7 +12,7 @@ import Input from '../common/Input'
import LoginButton from '../common/LoginButton' import LoginButton from '../common/LoginButton'
import PasswordInput from '../common/passwordInput' import PasswordInput from '../common/passwordInput'
// import VeriCodeButton from '../common/veriCodeInput' // import VeriCodeButton from '../common/veriCodeInput'
// import LoginWays from '../common/LoginWays' import LoginWays from '../common/LoginWays'
class AccountLogin extends PureComponent { class AccountLogin extends PureComponent {
...@@ -22,6 +22,7 @@ class AccountLogin extends PureComponent { ...@@ -22,6 +22,7 @@ class AccountLogin extends PureComponent {
render() { render() {
const loginWays = this.props.loginWays.filter(item => item.text !== '账号登录')
return ( return (
<div className={'account-login'}> <div className={'account-login'}>
<Header/> <Header/>
...@@ -55,7 +56,7 @@ class AccountLogin extends PureComponent { ...@@ -55,7 +56,7 @@ class AccountLogin extends PureComponent {
<LoginButton/> <LoginButton/>
<Link className={'forgot-password-btn'} to='/passport/forgot-password'>忘记密码</Link> <Link className={'forgot-password-btn'} to='/passport/forgot-password'>忘记密码</Link>
</Form> </Form>
{/*<LoginWays loginWays={this.props.loginWays}/>*/} <LoginWays loginWays={loginWays}/>
</div> </div>
); );
} }
......
...@@ -52,8 +52,10 @@ class Passport extends Component { ...@@ -52,8 +52,10 @@ class Passport extends Component {
to={{...location, ...{pathname: '/passport/account-login'}}} to={{...location, ...{pathname: '/passport/account-login'}}}
/> />
<Route path={match.url + '/wechat-login'} <Route path={match.url + '/wechat-login'}
render={() => <WechatLogin loginWays={this.state.loginWays}/>}/> render={props => <WechatLogin {...props} loginWays={this.state.loginWays}/>}/>
<Route path={match.url + '/account-login'} component={AccountLogin}/> <Route path={match.url + '/account-login'} render={props => {
return <AccountLogin {...props} loginWays={this.state.loginWays}/>
}}/>
<Route path={match.url + '/forgot-password'} component={ForgotPassword}/> <Route path={match.url + '/forgot-password'} component={ForgotPassword}/>
<Route path={match.url + '/set-password'} component={SetPassword}/> <Route path={match.url + '/set-password'} component={SetPassword}/>
<Route path={match.url + '/binding-tel'} component={BindingTel}/> <Route path={match.url + '/binding-tel'} component={BindingTel}/>
......
...@@ -9,6 +9,16 @@ import { Form, FastField, withFormik } from "formik" ...@@ -9,6 +9,16 @@ import { Form, FastField, withFormik } from "formik"
class WechatLogin extends PureComponent { class WechatLogin extends PureComponent {
componentDidMount(){
console.log(this.props)
}
loginWaysClick = index => {
switch (index) {
case 0:
this.props.history.push('/passport/account-login')
}
}
render() { render() {
const { const {
...@@ -50,7 +60,7 @@ class WechatLogin extends PureComponent { ...@@ -50,7 +60,7 @@ class WechatLogin extends PureComponent {
<LoginButton/> <LoginButton/>
</Form> </Form>
<LoginWays onClick={this.selectLoginWays} loginWays={loginWays}/> <LoginWays onClick={this.loginWaysClick} loginWays={loginWays}/>
</div> </div>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment