Browse Source

新增 nowPrice 字段,作为返回。

hl 1 month ago
parent
commit
756a1961d8
2 changed files with 5 additions and 2 deletions
  1. 4 2
      src/robot.js
  2. 1 0
      src/web.js

+ 4 - 2
src/robot.js

@@ -40,8 +40,9 @@ function getApp(key) {
         programName: "",
         strategyName: "",
         childProcess: undefined,
-        nowBalance: -1,
-        posNum: -1,
+        nowBalance: 0,
+        posNum: 0,
+        nowPrice: 0,
         messlist: [],
         predictorState:[],
         threadStatus: RobotStatus.STOPPED,
@@ -518,6 +519,7 @@ function robotAmount(app) {
                 var d = JSON.parse(data)
                 app.nowBalance = d.now_balance
                 app.posNum = d.pos
+                app.nowPrice = d.now_price
 
                 //余额有变动上报一次
                 // logger.info(`余额当前:${(app.nowBalance + "")}--${(d.now_balance + "")}--`);

+ 1 - 0
src/web.js

@@ -54,6 +54,7 @@ function init() {
                 id: value.id,
                 nowBalance: value.nowBalance + "",
                 posNum: value.posNum + "",
+                nowPrice: value.nowPrice + "",
                 messlist: value.messlist,
                 threadStatus: value.threadStatus,
                 errorMessage: value.errorMessage,