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
5c1747e2
Commit
5c1747e2
authored
Oct 24, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录传redirect地址,统计用
parent
e04d633d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
src/components/passport/accountLogin/index.js
+2
-1
src/components/passport/login/index.js
+4
-3
src/store/userAction.js
+3
-3
No files found.
src/components/passport/accountLogin/index.js
View file @
5c1747e2
...
@@ -72,8 +72,9 @@ const formikConfig = {
...
@@ -72,8 +72,9 @@ const formikConfig = {
handleSubmit
(
values
,
formikBag
)
{
handleSubmit
(
values
,
formikBag
)
{
const
{
account
:
username
,
password
}
=
values
const
{
account
:
username
,
password
}
=
values
const
{
props
,
props
:
{
history
}}
=
formikBag
const
{
props
,
props
:
{
history
}}
=
formikBag
const
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
props
.
accountLogin
({
props
.
accountLogin
({
username
,
password
username
,
password
,
redirect
:
from
&&
window
.
location
.
origin
+
from
.
pathname
+
from
.
search
+
from
.
hash
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
,
2
,
null
,
false
)
Toast
.
info
(
res
.
msg
,
2
,
null
,
false
)
...
...
src/components/passport/login/index.js
View file @
5c1747e2
...
@@ -130,10 +130,12 @@ const FormikConfig = {
...
@@ -130,10 +130,12 @@ const FormikConfig = {
veriCode
:
''
veriCode
:
''
}),
}),
handleSubmit
(
values
,
{
props
})
{
handleSubmit
(
values
,
{
props
})
{
const
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
props
.
quickLogin
({
props
.
quickLogin
({
phone_num
:
values
.
tel
,
phone_num
:
values
.
tel
,
phone_code
:
values
.
veriCode
,
phone_code
:
values
.
veriCode
,
area_code
:
'00'
+
props
.
country
.
num
area_code
:
'00'
+
props
.
country
.
num
,
redirect
:
from
&&
window
.
location
.
origin
+
from
.
pathname
+
from
.
search
+
from
.
hash
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
);
Toast
.
info
(
res
.
msg
);
...
@@ -163,4 +165,4 @@ export default compose(
...
@@ -163,4 +165,4 @@ export default compose(
{
quickLogin
}
{
quickLogin
}
),
),
withFormik
(
FormikConfig
),
withFormik
(
FormikConfig
),
)(
Login
)
)(
Login
)
\ No newline at end of file
src/store/userAction.js
View file @
5c1747e2
...
@@ -7,7 +7,8 @@ const accountLogin = user => dispatch => {
...
@@ -7,7 +7,8 @@ const accountLogin = user => dispatch => {
return
http
.
post
(
`
${
API
[
'passport-api'
]}
/user_login`
,
{
return
http
.
post
(
`
${
API
[
'passport-api'
]}
/user_login`
,
{
user_name
:
user
.
username
,
user_name
:
user
.
username
,
password
:
encrypt
(
user
.
password
),
password
:
encrypt
(
user
.
password
),
is_encrypt
:
1
is_encrypt
:
1
,
redirect
:
user
.
redirect
}).
then
(
res
=>
{
}).
then
(
res
=>
{
return
storeUser
(
res
,
dispatch
)
return
storeUser
(
res
,
dispatch
)
})
})
...
@@ -80,4 +81,4 @@ export {
...
@@ -80,4 +81,4 @@ export {
updateUser
,
updateUser
,
START_FETCH_USER
,
START_FETCH_USER
,
startFetchUser
,
startFetchUser
,
}
}
\ No newline at end of file
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