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
2150b3ce
Commit
2150b3ce
authored
Jun 14, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'passport'
parents
a8aeb17c
758b4a63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
src/store/userAction.js
+11
-1
src/store/userReducer.js
+4
-2
No files found.
src/store/userAction.js
View file @
2150b3ce
...
@@ -57,9 +57,18 @@ const logout = () => dispatch => {
...
@@ -57,9 +57,18 @@ const logout = () => dispatch => {
}
}
const
UPDATE_USER
=
'UPDATE_USER'
const
updateUser
=
payload
=>
({
type
:
UPDATE_USER
,
payload
})
export
{
export
{
accountLogin
,
accountLogin
,
SET_CURRENT_USER
,
SET_CURRENT_USER
,
setCurrentUser
,
setCurrentUser
,
quickLogin
quickLogin
,
logout
,
UPDATE_USER
,
updateUser
}
}
\ No newline at end of file
src/store/userReducer.js
View file @
2150b3ce
import
{
SET_CURRENT_USER
}
from
'@/store/userAction'
;
import
{
SET_CURRENT_USER
,
UPDATE_USER
}
from
'@/store/userAction'
;
import
{
merge
}
from
'lodash'
const
initialState
=
{
const
initialState
=
{
...
@@ -15,11 +16,12 @@ const initialState = {
...
@@ -15,11 +16,12 @@ const initialState = {
}
}
export
default
function
(
state
=
initialState
,
action
)
{
export
default
function
(
state
=
initialState
,
action
)
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
case
SET_CURRENT_USER
:
case
SET_CURRENT_USER
:
return
action
.
payload
return
action
.
payload
case
UPDATE_USER
:
return
merge
({},
state
,
action
.
payload
)
default
:
default
:
return
state
return
state
}
}
...
...
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