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
f0ccf032
Commit
f0ccf032
authored
Jun 11, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证码登录
parent
f5161cb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
28 deletions
+23
-28
src/components/passport/login/index.js
+23
-28
No files found.
src/components/passport/login/index.js
View file @
f0ccf032
...
...
@@ -29,13 +29,6 @@ class WechatLogin extends Component {
}
}
handleClick
=
()
=>
{
/*setTimeout(() => {
console.log(this.props.errors)
})*/
console
.
log
(
this
.
props
.
errors
)
}
getCaptchaInstance
=
instance
=>
{
this
.
setState
({
captchaInstance
:
instance
...
...
@@ -76,28 +69,31 @@ class WechatLogin extends Component {
)}
>
<
/Field
>
<
Field
type
=
'number'
name
=
'veriCode'
render
=
{({
field
})
=>
(
<
VeriCodeInput
{...
field
}
className
=
{
'verification'
}
icon
=
{
<
i
className
=
{
'iconfont iconduanxin'
}
style
=
{{
fontSize
:
'20px'
,
left
:
'12px'
}}
/>
}
tel
=
{
values
.
tel
}
challenge
=
{
this
.
state
.
validate
}
errors
=
{
errors
}
placeholder
=
{
'请输入验证码'
}
instance
=
{
this
.
state
.
captchaInstance
}
/
>
)}
/
>
{
this
.
state
.
validate
&&
<
Field
type
=
'number'
name
=
'veriCode'
render
=
{({
field
})
=>
(
<
VeriCodeInput
{...
field
}
className
=
{
'verification'
}
icon
=
{
<
i
className
=
{
'iconfont iconduanxin'
}
style
=
{{
fontSize
:
'20px'
,
left
:
'12px'
}}
/>
}
tel
=
{
values
.
tel
}
challenge
=
{
this
.
state
.
validate
}
errors
=
{
errors
}
placeholder
=
{
'请输入验证码'
}
instance
=
{
this
.
state
.
captchaInstance
}
/
>
)}
/
>
}
<
Captcha
getInstance
=
{
this
.
getCaptchaInstance
}
onVerify
=
{
this
.
onVerify
}
/
>
<
LoginButton
onClick
=
{
this
.
handleClick
}
active
=
{
values
.
tel
&&
values
.
veriCode
&&
isEmpty
(
errors
)}
/
>
<
LoginButton
active
=
{
values
.
tel
&&
values
.
veriCode
&&
isEmpty
(
errors
)}
/
>
<
/Form
>
<
LoginWays
onClick
=
{
this
.
loginWaysClick
}
loginWays
=
{
loginWays
}
/
>
...
...
@@ -118,7 +114,7 @@ const FormikConfig = {
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
);
}
else
{
}
else
{
let
state
=
props
.
location
.
state
||
{
from
:
{
pathname
:
'/'
}}
props
.
history
.
replace
(
state
.
from
)
...
...
@@ -139,7 +135,6 @@ const FormikConfig = {
}
export
default
compose
(
connect
(
null
,
{
quickLogin
}
...
...
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