-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
febobo
authored and
febobo
committed
Jun 8, 2016
1 parent
d7c1f31
commit a1ab578
Showing
10 changed files
with
73 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {createAction} from 'redux-actions'; | ||
import * as types from './actionTypes'; | ||
import config from '../config' | ||
|
||
export const checkToken = createAction(types.CHECK_TOKEN , async(token) =>{ | ||
const params = { | ||
method : 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json' | ||
}, | ||
body : JSON.stringify({ | ||
accesstoken : token | ||
}) | ||
} | ||
const userLoginInfo = await fetch(`${config.domain}/accesstoken`, params); | ||
const loginUser = await userLoginInfo.json(); | ||
const user = await fetch(`${config.domain}/user/${loginUser.loginname}`); | ||
const userInfo = await user.json() | ||
// console.log(await user.json()) | ||
return userInfo; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import * as DetailActions from './DetailActions' | ||
import * as EssenceActions from './EssenceActions' | ||
import * as UserActions from './UserActions' | ||
import * as TabActions from './TabActions' | ||
|
||
export default { | ||
...DetailActions, | ||
...EssenceActions, | ||
...TabActions | ||
...TabActions, | ||
...UserActions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as types from '../actions/actionTypes'; | ||
|
||
const tabInitState = { | ||
count : 1 | ||
} | ||
export default function User (state=tabInitState , action={}){ | ||
switch (action.type) { | ||
case types.CHECK_TOKEN: | ||
return Object.assign( | ||
{} , state , { | ||
user : 1 | ||
} | ||
) | ||
break; | ||
default: | ||
return state; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters