Bladeren bron

价格校验

龚成明 2 jaren geleden
bovenliggende
commit
7094d2f8f3
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 5 5
      scripts/one-pro.js

+ 5 - 5
scripts/one-pro.js

@@ -71,10 +71,10 @@ const showInfo = function(context, task) {
     const orderPercentage = NumKit.getSubFloat(((BinancePrice - orderPrice) / orderPrice) * 100, 2)
     const nextTimeStr = token.nextHandleTime ? TimeKit.getTimeByMillisecond(token.nextHandleTime) : ''
 
-    // 价格非法的就不处理了
-    // if ((() => {
-    //
-    // })()) return
+    // 价格非法判定
+    const priceCondition = (() => {
+      return OneInchPrice && BinancePrice
+    })()
 
     const rows = [pair.toString(), BinancePrice.toString(), orderPrice.toString(), orderPercentage.toString().concat('%'), nextTimeStr]
 
@@ -86,7 +86,7 @@ const showInfo = function(context, task) {
       const isTimeCover = new Date().getTime() > token.nextHandleTime
       const timeCondition = isNoPrevHandleTime || isTimeCover
 
-      return percentageCondition && timeCondition
+      return priceCondition && percentageCondition && timeCondition
     })()
 
     // 打印表格