Commit aff2d076 by zhanghaozhe

引入验证码

parent a90316df
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<head>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"/>
<meta
name="viewport"
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
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.
It will be replaced with the URL of the `public` folder during the build.
......@@ -23,11 +23,11 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
......@@ -36,6 +36,27 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
-->
</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>
</html>
......@@ -12,7 +12,7 @@ import Input from '../common/Input'
import LoginButton from '../common/LoginButton'
import PasswordInput from '../common/passwordInput'
// import VeriCodeButton from '../common/veriCodeInput'
// import LoginWays from '../common/LoginWays'
import LoginWays from '../common/LoginWays'
class AccountLogin extends PureComponent {
......@@ -22,6 +22,7 @@ class AccountLogin extends PureComponent {
render() {
const loginWays = this.props.loginWays.filter(item => item.text !== '账号登录')
return (
<div className={'account-login'}>
<Header/>
......@@ -55,7 +56,7 @@ class AccountLogin extends PureComponent {
<LoginButton/>
<Link className={'forgot-password-btn'} to='/passport/forgot-password'>忘记密码</Link>
</Form>
{/*<LoginWays loginWays={this.props.loginWays}/>*/}
<LoginWays loginWays={loginWays}/>
</div>
);
}
......
......@@ -52,8 +52,10 @@ class Passport extends Component {
to={{...location, ...{pathname: '/passport/account-login'}}}
/>
<Route path={match.url + '/wechat-login'}
render={() => <WechatLogin loginWays={this.state.loginWays}/>}/>
<Route path={match.url + '/account-login'} component={AccountLogin}/>
render={props => <WechatLogin {...props} loginWays={this.state.loginWays}/>}/>
<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 + '/set-password'} component={SetPassword}/>
<Route path={match.url + '/binding-tel'} component={BindingTel}/>
......
......@@ -9,6 +9,16 @@ import { Form, FastField, withFormik } from "formik"
class WechatLogin extends PureComponent {
componentDidMount(){
console.log(this.props)
}
loginWaysClick = index => {
switch (index) {
case 0:
this.props.history.push('/passport/account-login')
}
}
render() {
const {
......@@ -50,7 +60,7 @@ class WechatLogin extends PureComponent {
<LoginButton/>
</Form>
<LoginWays onClick={this.selectLoginWays} loginWays={loginWays}/>
<LoginWays onClick={this.loginWaysClick} loginWays={loginWays}/>
</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