| | |
| | | clearSecurity(req, res); |
| | | }); |
| | | |
| | | //添加应急开仓密码 |
| | | server.route("/insertEmergencyPassword", function (req, res) { |
| | | insertEmergencyPassword(req, res); |
| | | }); |
| | | //查询应急开仓密码 |
| | | server.route("/getEmergencyPassword", function (req, res) { |
| | | getEmergencyPassword(req, res); |
| | | }); |
| | | //清空应急开仓密码 |
| | | server.route("/clearEmergencyPassword", function (req, res) { |
| | | clearEmergencyPassword(req, res); |
| | | }); |
| | | |
| | | //获取指纹特征 |
| | | server.route("/getFingerChar", function (req, res) { |
| | | getFingerChar(req, res); |
| | |
| | | res.send(JSON.stringify(result), { "Content-Type": "application/json" }); |
| | | } |
| | | |
| | | // 添加应急开仓密码 |
| | | function insertEmergencyPassword(req, res) { |
| | | let result = { |
| | | code: 400, |
| | | message: "", |
| | | data: {}, |
| | | } |
| | | if (verifyToken(req)) { |
| | | let body = req.body; |
| | | body = JSON.parse(body).data; |
| | | try { |
| | | let res = api.insertEmergencyPassword(body) |
| | | if (typeof res == 'string') { |
| | | result.data = res |
| | | } else { |
| | | result.code = 200 |
| | | } |
| | | } catch (error) { |
| | | result.message = error.message |
| | | } |
| | | } else { |
| | | result = messageExpired |
| | | } |
| | | res.send(JSON.stringify(result), { "Content-Type": "application/json" }); |
| | | } |
| | | |
| | | // 查询应急开仓密码 |
| | | function getEmergencyPassword(req, res) { |
| | | let result = { |
| | | code: 400, |
| | | message: "", |
| | | data: {}, |
| | | } |
| | | if (verifyToken(req)) { |
| | | try { |
| | | let res = api.getEmergencyPassword() |
| | | result.code = 200 |
| | | result.data = res |
| | | } catch (error) { |
| | | result.message = error.message |
| | | } |
| | | } else { |
| | | result = messageExpired |
| | | } |
| | | res.send(JSON.stringify(result), { "Content-Type": "application/json" }); |
| | | } |
| | | |
| | | // 清空应急开仓密码 |
| | | function clearEmergencyPassword(req, res) { |
| | | let result = { |
| | | code: 400, |
| | | message: "", |
| | | data: {}, |
| | | } |
| | | if (verifyToken(req)) { |
| | | try { |
| | | let res = api.clearEmergencyPassword() |
| | | if (typeof res == 'string') { |
| | | result.data = res |
| | | } else { |
| | | result.code = 200 |
| | | } |
| | | } catch (error) { |
| | | result.message = error.message |
| | | } |
| | | } else { |
| | | result = messageExpired |
| | | } |
| | | res.send(JSON.stringify(result), { "Content-Type": "application/json" }); |
| | | } |
| | | |
| | | // 获取指纹特征 |
| | | function getFingerChar(req,res) { |
| | | let result = { |