Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
taroMeeting
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
fengzhaoyu
taroMeeting
Commits
48c6eafa
Commit
48c6eafa
authored
6 years ago
by
王树冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear
parent
785071f8
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
29 deletions
+2
-29
index.js
src/actions/index.js
+1
-16
status.js
src/const/status.js
+1
-11
counter.js
src/reducers/counter.js
+0
-2
No files found.
src/actions/index.js
View file @
48c6eafa
/**
* 创建Action
*
* @export
* @param actionType Action类型
*/
export
function
createAction
(
actionType
)
{
export
function
createAction
(
actionType
)
{
return
(
payload
)
=>
({
return
(
payload
)
=>
({
type
:
actionType
,
type
:
actionType
,
...
@@ -11,16 +5,7 @@ export function createAction(actionType) {
...
@@ -11,16 +5,7 @@ export function createAction(actionType) {
})
})
}
}
/**
* 创建API Action
*
* @export
* @param actionType Action类型
* @param [func] 请求API方法,返回Promise
* @returns 请求之前dispatch { type: ${actionType}_request }
* 请求成功dispatch { type: ${actionType}, payload: ${resolveData} }
* 请求失败dispatch { type: ${actionType}_failure, payload: ${rejectData} }
*/
export
function
createApiAction
(
actionType
,
func
=
()
=>
{})
{
export
function
createApiAction
(
actionType
,
func
=
()
=>
{})
{
return
(
return
(
params
=
{},
params
=
{},
...
...
This diff is collapsed.
Click to expand it.
src/const/status.js
View file @
48c6eafa
...
@@ -10,16 +10,6 @@ export const HTTP_STATUS = {
...
@@ -10,16 +10,6 @@ export const HTTP_STATUS = {
GATEWAY_TIMEOUT
:
504
GATEWAY_TIMEOUT
:
504
}
}
// export const COMMON_STATUS = {
// NOT_FOUND: -40400, // "请求资源不存在",
// API_NOT_FOUND: -40401, // "请求方法不存在",
// EXCEPTION: -50000, // "系统异常",
// PARAM_ERROR: -40001, // "参数错误",
// AUTH_FAILED: -40100, // "认证错误",
// NO_PERMISION: -40302, // "没有权限",
// NET_REQUEST_FAILED: -40000, // "网络请求失败",
// }
// promise status
// promise status
export
const
SUCCESS
=
{
success
:
'success'
}
export
const
SUCCESS
=
{
success
:
'success'
}
export
const
FAIL
=
{
fail
:
'fail'
}
export
const
FAIL
=
{
fail
:
'fail'
}
...
@@ -33,5 +23,5 @@ export const PROMISE_STATUS = {
...
@@ -33,5 +23,5 @@ export const PROMISE_STATUS = {
export
const
RESULT_STATUS
=
{
export
const
RESULT_STATUS
=
{
SUCCESS
:
0
,
SUCCESS
:
0
,
SIGNATURE_FAILED
:
-
12
00
// 签名失败
SIGNATURE_FAILED
:
10
00
// 签名失败
}
}
This diff is collapsed.
Click to expand it.
src/reducers/counter.js
View file @
48c6eafa
...
@@ -21,8 +21,6 @@ export default function counter (state = INITIAL_STATE, action) {
...
@@ -21,8 +21,6 @@ export default function counter (state = INITIAL_STATE, action) {
case
LIST
:
case
LIST
:
let
data
=
state
.
list
.
concat
(
action
.
payload
.
data
)
let
data
=
state
.
list
.
concat
(
action
.
payload
.
data
)
// Object.assign(state.list, action.payload.data.news)
// Object.assign(state.list, action.payload.data.news)
console
.
log
(
'data'
,
data
)
console
.
log
(
'state'
,
state
)
return
{
return
{
...
state
,
...
state
,
// list: action.payload.data.news
// list: action.payload.data.news
...
...
This diff is collapsed.
Click to expand it.
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