【发布时间】:2018-04-11 02:30:27
【问题描述】:
我的 web3 常量看起来像这样。
const test = contract_instance.methods.getPost(15).call().then(console.log);
这样返回结果。
Result {
'0': '2017-08-28',
'1': '19:18:04.986593',
'2': '07:17:00',
'3': '11112323',
'4': '12',
date: '2017-08-28',
login_time: '19:18:04.986593',
logout_time: '07:17:00',
login_device_id: '11112323',
user_id: '12' }
现在,当我想通过 console.log(test[0]); 控制单个标签时,这将返回 undefined 我的方法是将每个结果标签存储在其单独的变量中。需要一些建议。
【问题讨论】:
标签: ethereum solidity contract web3js go-ethereum