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
bc38186a
Commit
bc38186a
authored
Sep 11, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录
parent
5c4ab36f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
src/components/passport/accountLogin/index.js
+2
-2
src/components/passport/index.js
+5
-6
No files found.
src/components/passport/accountLogin/index.js
View file @
bc38186a
...
@@ -74,7 +74,7 @@ const formikConfig = {
...
@@ -74,7 +74,7 @@ const formikConfig = {
const
{
props
,
props
:
{
history
}}
=
formikBag
const
{
props
,
props
:
{
history
}}
=
formikBag
props
.
accountLogin
({
props
.
accountLogin
({
username
,
password
username
,
password
}).
then
(
res
=>
{
})
/*
.then(res => {
if (!res.hasError) {
if (!res.hasError) {
let {from} = props.location.state || {from: {pathname: '/', search: ''}}
let {from} = props.location.state || {from: {pathname: '/', search: ''}}
console.log(from, 'account');
console.log(from, 'account');
...
@@ -82,7 +82,7 @@ const formikConfig = {
...
@@ -82,7 +82,7 @@ const formikConfig = {
} else {
} else {
Toast.info(res.msg, 2, null, false)
Toast.info(res.msg, 2, null, false)
}
}
})
})
*/
}
}
}
}
...
...
src/components/passport/index.js
View file @
bc38186a
...
@@ -65,16 +65,15 @@ class Passport extends Component {
...
@@ -65,16 +65,15 @@ class Passport extends Component {
routeWhenUserLoggedIn
=
()
=>
{
routeWhenUserLoggedIn
=
()
=>
{
let
{
history
}
=
this
.
props
let
{
history
,
location
}
=
this
.
props
let
{
data
}
=
this
.
props
.
user
let
{
data
}
=
this
.
props
.
user
if
(
data
&&
Object
.
values
(
data
).
filter
(
item
=>
!!
item
).
length
)
{
if
(
data
&&
Object
.
values
(
data
).
filter
(
item
=>
!!
item
).
length
)
{
console
.
log
(
history
);
if
(
history
.
action
===
'POP'
&&
history
.
length
<=
3
)
{
if
(
history
.
action
===
'POP'
&&
history
.
length
<=
3
)
{
console
.
log
(
'push'
);
history
.
push
(
'/'
)
history
.
push
(
'/'
)
}
else
{
}
else
{
console
.
log
(
'go'
);
const
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
,
search
:
''
}}
history
.
go
(
-
1
)
history
.
replace
(
from
)
}
}
}
}
}
}
...
...
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