Explorar el Código

pending页面
1.hash没有0x 加0x
2.搜索最上面 如果输入了正block 也是搜-block

skyfffire hace 3 años
padre
commit
5e86cf0521
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/plugins/model/EthMev.js

+ 5 - 0
src/plugins/model/EthMev.js

@@ -16,6 +16,8 @@ export default class EthMev {
   }
 
   static async getEthMevPendingData(block, hash, dataVague, page=1, size=200) {
+    if (!isNaN(parseInt(block)) && block.charAt(0) !== '-') block = '-' + block
+
     const url = '/ethmev/findByHashOrBlockOrDataVaguePending'
     const rst = await http.post(url, {
       block: block,
@@ -62,6 +64,9 @@ export default class EthMev {
         history.pending = dataObj.pending
         history.tradeInfoList = dataObj.tradeInfo
 
+        // hash异常处理
+        if (history.hash.indexOf('0x') === -1 && history.hash.length === 64) history.hash = '0x' + history.hash
+
         // token处理
         history.tokenMap = {}
         history.tradeInfoList.map(function (tradeInfo) {