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

长时拍数据

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