Skip to content

Commit

Permalink
Merge pull request #7 from KenianShi/dev
Browse files Browse the repository at this point in the history
修改返回格式
  • Loading branch information
KenianShi authored Nov 5, 2021
2 parents 96600e5 + 28f3d7b commit c69c8e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/inputSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default {
if (res.code == 4) {
this.$router.push({ path: "/null", query: { id: value } });
this.$emit("SearchValue", value);
} else if (res.msg == "txs") {
} else if (res.msg == "tx") {
this.$router.push({ path: "/transaction", query: { id: value } });
} else if (res.msg == "") {
} else if (res.msg == "block") {
this.$emit("SearchValue", value);
this.$router.push({ path: "/blockDetails", query: { id: value } });
} else if (res.code == 1) {
Expand Down
7 changes: 3 additions & 4 deletions src/views/BlockDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,11 @@ export default {
//搜索
async getSearchList(data) {
let res = await getSearch(data);
this.ResultsOf = res.data.data[0];
let txs = res.data.data[0].txs.split(",");
txs.map(async (item) => {
this.ResultsOf = res.data;
res.data.txs.map(async (item) => {
//获取交易列表
let res = await getTransActions(item);
this.TransactionList = res.txs;
this.TransactionList.push(...res.txs);
this.total = this.TransactionList.length;
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/views/Transaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
async getSearchList(data) {
let res = await getSearch(data);
this.jsonData = res;
this.ResultsOf = res.data[0];
this.ResultsOf = res.data;
},
},
mounted() {
Expand Down

0 comments on commit c69c8e2

Please sign in to comment.