Skip to content

Commit c69c8e2

Browse files
authored
Merge pull request #7 from KenianShi/dev
修改返回格式
2 parents 96600e5 + 28f3d7b commit c69c8e2

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/components/inputSearch.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export default {
3030
if (res.code == 4) {
3131
this.$router.push({ path: "/null", query: { id: value } });
3232
this.$emit("SearchValue", value);
33-
} else if (res.msg == "txs") {
33+
} else if (res.msg == "tx") {
3434
this.$router.push({ path: "/transaction", query: { id: value } });
35-
} else if (res.msg == "") {
35+
} else if (res.msg == "block") {
3636
this.$emit("SearchValue", value);
3737
this.$router.push({ path: "/blockDetails", query: { id: value } });
3838
} else if (res.code == 1) {

src/views/BlockDetails.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,11 @@ export default {
208208
//搜索
209209
async getSearchList(data) {
210210
let res = await getSearch(data);
211-
this.ResultsOf = res.data.data[0];
212-
let txs = res.data.data[0].txs.split(",");
213-
txs.map(async (item) => {
211+
this.ResultsOf = res.data;
212+
res.data.txs.map(async (item) => {
214213
//获取交易列表
215214
let res = await getTransActions(item);
216-
this.TransactionList = res.txs;
215+
this.TransactionList.push(...res.txs);
217216
this.total = this.TransactionList.length;
218217
});
219218
},

src/views/Transaction.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default {
138138
async getSearchList(data) {
139139
let res = await getSearch(data);
140140
this.jsonData = res;
141-
this.ResultsOf = res.data[0];
141+
this.ResultsOf = res.data;
142142
},
143143
},
144144
mounted() {

0 commit comments

Comments
 (0)