提交 0e05e229 编写于 作者: J jinlong12

历史页面接口修改

上级 92042d44
......@@ -40,11 +40,11 @@ const user = require('./routes/user');
app.use('/user', user);
const history = require('./routes/history');
app.use('/history', history);
app.use('/blockList', history);
app.use('/blockHeight', history);
app.use('/blockHash', history);
app.use('/transactionHash', history);
app.use('/transactionList', history);
app.use('/blocks', history);
app.use('/block/height/*', history);
app.use('/block/hash/*', history);
app.use('/tx/*', history);
app.use('/txs/height', history);
const contract = require('./routes/contract');
app.use('/contract', contract);
const ledgers = require('./routes/ledgers');
......
......@@ -827,7 +827,7 @@ router.get('/ledger/participants', function(req, res) {
});
});
// 区块列表
router.get('/blockList', function(req, res) {
router.get('/blocks', function(req, res) {
res.type('json');
let params = req.body,
ret = {};
......@@ -1093,7 +1093,7 @@ router.get('/blockList', function(req, res) {
});
});
// 区块高度
router.get('/blockHeightData', function(req, res) {
router.get('/block/height/*', function(req, res) {
res.type('json');
let params = req.body,
ret = {};
......@@ -1194,7 +1194,7 @@ router.get('/blockHeightData', function(req, res) {
});
// 区块哈希
router.get('/blockHash', function(req, res) {
router.get('/block/hash/*', function(req, res) {
res.type('json');
let params = req.body,
ret = {};
......@@ -1295,7 +1295,7 @@ router.get('/blockHash', function(req, res) {
});
// 交易列表
router.get('/transactionList', function(req, res) {
router.get('/txs/height', function(req, res) {
res.type('json');
let params = req.body,
ret = {};
......@@ -1742,7 +1742,7 @@ router.get('/transactionList', function(req, res) {
});
// 交易哈希
router.get('/transactionHash', function(req, res) {
router.get('/tx/*', function(req, res) {
res.type('json');
let params = req.body,
ret = {};
......
......@@ -61,6 +61,10 @@ export default class Header extends Component {
this.defaultValue = this.optionData[e].value ? this.optionData[e].value : '';
}
getChildContext() {
return {color: 'red'};
}
@autobind
onSelect({ item, key, selectedKeys }) {
location.href = '/pages/page' + key+'.html';
......
......@@ -20,6 +20,7 @@ export default class BlockHistory extends Component {
}
handleChangeHeight = (e) => {
console.log(e);
const { store } = this.props;
Promise.all([
store.getBlockHeightData()
......
......@@ -67,7 +67,7 @@ class DataTable extends Component {
if (this.inputValue != '') {
if (this.radioValue == 'blockHeight') {
Promise.all([
store.getBlockHeightData()
store.getBlockHeightData(this.inputValue)
]).then(
).catch((err) => {
......@@ -75,7 +75,7 @@ class DataTable extends Component {
});
} else if (this.radioValue == 'blockHash') {
Promise.all([
store.getBlockHashData()
store.getBlockHashData(this.inputValue)
]).then(
).catch((err) => {
......@@ -83,7 +83,7 @@ class DataTable extends Component {
});
} else {
Promise.all([
store.getTransactionHashData()
store.getTransactionHashData(this.inputValue)
]).then(
).catch((err) => {
......
......@@ -17,7 +17,7 @@ export default class ContractStore {
@autobind
@action
getContractData(e) {
console.log(e);
console.log(e, this);
fetchData(`${G_WEB_DOMAIN}/ledgers/contract/${e}`,
this.setContractData,
'', {
......
......@@ -169,7 +169,7 @@ export default class HistoryStore {
@autobind
@action
getBlockHistoryData() {
fetchData(`${G_WEB_DOMAIN}/ledgers/blockList`,
fetchData(`${G_WEB_DOMAIN}/ledgers/blocks`,
this.setBlockHistoryData,
'', { method: 'get',}
).catch(error => {
......@@ -188,8 +188,8 @@ export default class HistoryStore {
@autobind
@action
getBlockHeightData() {
fetchData(`${G_WEB_DOMAIN}/ledgers/blockHeightData`,
getBlockHeightData(e) {
fetchData(`${G_WEB_DOMAIN}/ledgers/block/height/${e}`,
this.setBlockHeightData,
'', { method: 'get',}
).catch(error => {
......@@ -209,8 +209,8 @@ export default class HistoryStore {
@autobind
@action
getBlockHashData() {
fetchData(`${G_WEB_DOMAIN}/ledgers/blockHash`,
getBlockHashData(e) {
fetchData(`${G_WEB_DOMAIN}/ledgers/block/hash/${e}`,
this.setBlockHashData,
'', { method: 'get',}
).catch(error => {
......@@ -230,8 +230,8 @@ export default class HistoryStore {
@autobind
@action
getTransactionHashData() {
fetchData(`${G_WEB_DOMAIN}/ledgers/transactionHash`,
getTransactionHashData(e) {
fetchData(`${G_WEB_DOMAIN}/ledgers/tx/${e}`,
this.setTransactionHashData,
'', { method: 'get',}
).catch(error => {
......@@ -265,7 +265,7 @@ export default class HistoryStore {
@autobind
@action
getTransactionList() {
fetchData(`${G_WEB_DOMAIN}/ledgers/transactionList`,
fetchData(`${G_WEB_DOMAIN}/ledgers/txs/height`,
this.setTransactionList,
'', { method: 'get',}
).catch(error => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册