Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
aff2d076
Commit
aff2d076
authored
Jun 10, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
引入验证码
parent
a90316df
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
17 deletions
+51
-17
public/index.html
+33
-12
src/components/passport/accountLogin/index.js
+3
-2
src/components/passport/index.js
+4
-2
src/components/passport/wechatLogin/index.js
+11
-1
No files found.
public/index.html
View file @
aff2d076
<!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>
src/components/passport/accountLogin/index.js
View file @
aff2d076
...
...
@@ -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
>
);
}
...
...
src/components/passport/index.js
View file @
aff2d076
...
...
@@ -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
}
/
>
...
...
src/components/passport/wechatLogin/index.js
View file @
aff2d076
...
...
@@ -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
>
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment