diff --git a/src/i18n/en.js b/src/i18n/en.js index 833aac7..89d69ad 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -35,12 +35,12 @@ export default { tableNone: '暂无数据', }, chain: { - tableHeader: '区块列表', + tableHeader: 'Block List', searchHolder: '请输入该输入的', - thHeight: '区块高度', - thTimestamp: '时间戳', - thType: '区块类型', - thId: '区块 ID', + thHeight: 'Height', + thTimestamp: 'Timestamp', + thType: 'Type', + thHash: 'Hash', tableNone: '暂无数据', }, } diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 93a4f6d..973c5a4 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -40,7 +40,7 @@ export default { thHeight: '区块高度', thTimestamp: '时间戳', thType: '区块类型', - thId: '区块 ID', + thHash: '区块哈希', tableNone: '暂无数据', }, } diff --git a/src/services/axios.js b/src/services/axios.js index c0d5a18..6bd00dd 100644 --- a/src/services/axios.js +++ b/src/services/axios.js @@ -1,4 +1,4 @@ import axios from 'axios' import app from './app' -axios.defaults.baseURL = app.dev ? 'http://localhost:6842/' : 'http://test-sg.bittic.net:6842/' +axios.defaults.baseURL = app.dev ? 'http://test-sg.bittic.net:6842/api/' : 'http://test-sg.bittic.net:6842/api/' diff --git a/src/store/modules/chain.js b/src/store/modules/chain.js index 8b210d3..469ff9e 100644 --- a/src/store/modules/chain.js +++ b/src/store/modules/chain.js @@ -1,3 +1,5 @@ +import axios from 'axios' + export default { namespaced: true, @@ -7,14 +9,14 @@ export default { { text: 'chain.thHeight', value: 'height', align: 'center' }, { text: 'chain.thTimestamp', value: 'timestamp', align: 'center' }, { text: 'chain.thType', value: 'type', align: 'center' }, - { text: 'chain.thId', value: 'id', align: 'center' }, + { text: 'chain.thHash', value: 'hash', align: 'center' }, ], desserts: [ { height: '1', timestamp: '2011-11-20', type: '0', - id: 'ajlk;gaklewklgjqwejj', + hash: 'ajlk;gaklewklgjqwejj', }, ], fetching: false, @@ -34,9 +36,20 @@ export default { hideModal(state) { state.modal = false }, + + updateDesserts(state, blockList){ + state.desserts=blockList + } }, - actions: {}, + actions: { + async queryBlockList({state, commit}){ + console.log('current desserts are ') + console.log(state.desserts) + let result=await axios.post('Block/getBlockList', {config:{order:'height DESC'}}) + commit('updateDesserts', result.data||[]) + }, + }, getters: {}, } diff --git a/src/store/modules/owner.js b/src/store/modules/owner.js index 6cced85..ebd969b 100644 --- a/src/store/modules/owner.js +++ b/src/store/modules/owner.js @@ -47,7 +47,7 @@ export default { let account = sessionStorage.getItem('KEY_ACCOUNT') try { account = JSON.parse(account) - const result = await axios.post('api/Account/getBalance', { + const result = await axios.post('Account/getBalance', { Account: { address: account.address }, }) commit('updateBalance', result.data || 0) diff --git a/src/views/Chain.vue b/src/views/Chain.vue index 0bca62e..2b2f246 100644 --- a/src/views/Chain.vue +++ b/src/views/Chain.vue @@ -36,7 +36,7 @@