使用回调后反应不起作用?

时间:2018-06-18 09:56:09

标签: javascript reactjs callback

我正在调用Ajax调用export function _getSingleContracts(data, callback) { let token = localStorage.getItem('accessToken'); let url = "/contracts/read?access_token=" + token; let BASE = "http://172.14.136.4:1082" let actualurl = BASE + url; Api._callAPI(actualurl, 'GET', data, (type, dt) => { if (type == 'success') { dispatcher.dispatch({ type: 'SingleContract', data: dt, }) callback(dt); } }); } 我正在调用API

_getSingleContract

_generatePDF我正在回电,但我仍然无法拨打_getSingleContract(id) { let data = { id: this.state.cell.row, }; ContractAction._getSingleContracts(data, function(data) { console.log(data.contract.html); let data1 = data.contract.html; ContractAction._generatePDF(data1); }); } 功能

old_dict = old_config._sections
new_dict = new_config._sections

请任何人指导我使用回调。

0 个答案:

没有答案