Commit 41013d7c authored by 王迪's avatar 王迪

长时拍数据

parent fca68a54
const HOST = 'http://localhost:3600/api/'; const HOST = 'http://localhost:3600/api/';
const DEV = 'http://192.168.155.56'; // 开发环境
const TEST = 'http://192.168.155.26'; // 测试环境
const PRE = 'http://test.biz.taoche.com'; // 预发布环境
const PROD = 'https://h5-biz.taoche.com'; // 生产环境
function _apiFetch(uri, params, headers, method = 'GET') { function _apiFetch(url, params, headers, method = 'GET') {
return fetch(`${HOST}${uri}`, { return fetch(`${TEST}${url}`, {
headers: Object.assign({ headers: Object.assign({
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Cache-Control': 'no-cache' 'Cache-Control': 'no-cache',
'x-access-token': 'd2de6bf1-6f29-4a8d-9bb3-d96789c3fd97'
}, headers), }, headers),
method, method,
body: JSON.stringify(params) body: JSON.stringify(params)
...@@ -21,6 +26,6 @@ function _authFetch(config) { ...@@ -21,6 +26,6 @@ function _authFetch(config) {
export default { export default {
getListData(params) { getListData(params) {
return _apiFetch('listdata', params); return _apiFetch('/v1/license-certificate/query', {}, {}, 'POST');
}, },
}; };
...@@ -14,8 +14,8 @@ export function getLongAuctionList(params) { ...@@ -14,8 +14,8 @@ export function getLongAuctionList(params) {
try { try {
const res = await api.getListData(); const res = await api.getListData();
const resJson = await res.json(); const resJson = await res.json();
if (res.status === 200) { if (resJson.code === 0) {
dispatch(getLoanListSucc(resJson.listData)); dispatch(getLoanListSucc(resJson.data.record));
} }
} catch (err) { } catch (err) {
console.warn(err); console.warn(err);
......
...@@ -12,6 +12,7 @@ export default function auctionReducer (state = initialState, action) { ...@@ -12,6 +12,7 @@ export default function auctionReducer (state = initialState, action) {
switch (action.type) { switch (action.type) {
case GET_LIST_SUCC: { case GET_LIST_SUCC: {
const listData = fromJS(action.payload); const listData = fromJS(action.payload);
console.log(listData);
return state.setIn(['listData'], listData); return state.setIn(['listData'], listData);
} }
} }
......
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