這樣調接口取參數id怎么會報錯呢?這是個彈出框 有兩個頁面會公用這個彈出框 另一個頁面調完沒有問題 這個就報錯了報錯:showApproveState(show,record) {
const {busiType} = this.props;
let busi_type = busiType?busiType:''; this.props.getApplyAudit(record.id,busi_type=='container'?'container':'apply'); this.setState({
ApproveStateVisible: show,
})
}//action文件
export function getApplyAudit(id,type,state) {
const path='/auditing/getApplyAuditInfo';
return{
type:"APPLY_AUDIT_INFO",
payload: {
promise: api.get(path, {
params:{
id,
type, state
}
})
}
}
}
//reducer文件
case 'APPLY_AUDIT_INFO_PENDING':
return {...state,auditStateList:{loading:true}};
case 'APPLY_AUDIT_INFO_SUCCESS':
return {...state,auditStateList:{result:action.payload, loading:false}};
case 'APPLY_AUDIT_INFO_ERROR':
return {...state,auditStateList:{loading:false}};
添加回答
舉報
0/150
提交
取消