Commit 48c6eafa by 王树冬

clear

parent 785071f8
/**
* 创建Action
*
* @export
* @param actionType Action类型
*/
export function createAction(actionType) {
return (payload) => ({
type: 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 = () => {}) {
return (
params = {},
......
......@@ -10,16 +10,6 @@ export const HTTP_STATUS = {
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
export const SUCCESS = { success:'success'}
export const FAIL = { fail:'fail'}
......@@ -33,5 +23,5 @@ export const PROMISE_STATUS = {
export const RESULT_STATUS = {
SUCCESS:0,
SIGNATURE_FAILED: -1200 // 签名失败
SIGNATURE_FAILED: 1000 // 签名失败
}
......@@ -21,8 +21,6 @@ export default function counter (state = INITIAL_STATE, action) {
case LIST:
let data = state.list.concat(action.payload.data)
// Object.assign(state.list, action.payload.data.news)
console.log('data',data)
console.log('state',state)
return {
...state,
// list: action.payload.data.news
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment