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
17482b6c
Commit
17482b6c
authored
Jan 15, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账号登录
parent
48f9746a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
src/components/passport/accountLogin/index.js
+19
-10
No files found.
src/components/passport/accountLogin/index.js
View file @
17482b6c
import
React
,
{
PureComponent
}
from
"react"
import
'./accountLogin.scss'
import
{
Link
}
from
"react-router-dom"
;
import
{
withFormik
,
FastField
,
Form
}
from
"formik"
;
import
{
compose
}
from
'redux'
;
import
{
accountLogin
}
from
'@/store/userAction'
;
import
{
connect
}
from
"react-redux"
;
import
{
Link
}
from
"react-router-dom"
import
{
withFormik
,
FastField
,
Form
}
from
"formik"
import
{
compose
}
from
'redux'
import
{
accountLogin
}
from
'@/store/userAction'
import
{
connect
}
from
"react-redux"
import
{
isEmpty
}
from
'lodash'
import
{
HeaderBar
}
from
"@/common"
;
import
{
HeaderBar
}
from
"@/common"
import
Header
from
"../common/Header"
;
import
Header
from
"../common/Header"
import
Input
from
'../common/Input'
import
LoginButton
from
'../common/LoginButton'
import
PasswordInput
from
'../common/passwordInput'
import
{
Toast
}
from
"antd-mobile"
;
import
{
Toast
}
from
"antd-mobile"
class
AccountLogin
extends
PureComponent
{
...
...
@@ -60,7 +60,7 @@ class AccountLogin extends PureComponent {
<
Link
className
=
{
'forgot-password-btn'
}
to
=
'/passport/forgot-password'
>
忘记密码
<
/Link
>
<
/Form
>
<
/div
>
);
)
}
}
...
...
@@ -74,12 +74,21 @@ const formikConfig = {
const
{
props
,
props
:
{
history
}}
=
formikBag
const
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
props
.
accountLogin
({
username
,
password
,
redirect
:
from
&&
window
.
location
.
origin
+
from
.
pathname
+
from
.
search
+
from
.
hash
username
,
password
,
redirect
:
from
&&
window
.
location
.
origin
+
from
.
pathname
+
from
.
search
+
from
.
hash
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
,
2
,
null
,
false
)
}
})
},
validate
:
values
=>
{
const
errors
=
{}
if
(
!
values
.
account
)
{
errors
.
account
=
'账号不能为空'
}
else
if
(
!
values
.
password
)
{
errors
.
password
=
'密码不能为空'
}
return
errors
}
}
...
...
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