diff --git a/js/codeManage/operManage.js b/js/codeManage/operManage.js index 9aae93a..b88f619 100644 --- a/js/codeManage/operManage.js +++ b/js/codeManage/operManage.js @@ -134,7 +134,7 @@ var startContractAtSlave = function() { $("#result")[0].innerHTML="正在启动,请稍候"; var request = {}; request.action = "startContractByYPK"; - if (createParam !='') { + if (createParam.value !='') { request.createParam = createParam.value; $("#createParam").css("color",""); if (autoConvertStr.value=='on') { @@ -144,6 +144,8 @@ var startContractAtSlave = function() { }catch(e){ console.log(e); $("#createParam").css("color","red"); + alert("Create Param not JSON Format"); + return; } }else{ } @@ -206,6 +208,22 @@ function startContractUnits(place) { } request.isPrivate = global.ypkIsPrivate; request.sponsorPeerID = global.peerID; //peerID of the node + if (createParam.value !='') { + request.createParam = createParam.value; + $("#createParam").css("color",""); + if (autoConvertStr.value=='on') { + try{ + request.createParam = JSON.parse(request.createParam); + $("#createParam").css("color",""); + }catch(e){ + console.log(e); + $("#createParam").css("color","red"); + alert("Create Param not JSON Format"); + return; + } + }else{ + } + } console.log(request); global.wssocket.send(JSON.stringify(request)); }