我正在调用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
请任何人指导我使用回调。