diff --git a/js/onlineide/rightmenu.js b/js/onlineide/rightmenu.js index 7fe7e4a..af0d124 100644 --- a/js/onlineide/rightmenu.js +++ b/js/onlineide/rightmenu.js @@ -174,7 +174,7 @@ function importContractInstanceCodeByDOI() { function openInClient() { let path = document.location.pathname.lastIndexOf("/ide"); - if (path>0) + if (path > 0) path = document.location.pathname.substr(0, path + 1); else path = "/"; window.open(isBaaS ? @@ -222,15 +222,15 @@ function executeContract() { request.contractID = contract.id; request.operation = contract.exportedFunctions[selectedFunction.value].functionName; const arg = executeContractArgInput.value; - const gasLimit = $('#gasLimit').val()/1; + const gasLimit = $('#gasLimit').val() / 1; request.pubkey = sm2Key.publicKey; - var toSign = request.contractID + "|" - + request.operation + "|" + arg ; - if (gasLimit>0){ - request.gasLimit = gasLimit; - toSign+= "|" + gasLimit; + let toSign = request.contractID + "|" + + request.operation + "|" + arg; + if (gasLimit > 0) { + request.gasLimit = gasLimit; + toSign += "|" + gasLimit; } - toSign+= "|" + sm2Key.publicKey; + toSign += "|" + sm2Key.publicKey; request.signature = sm2.doSignature( toSign, sm2Key.privateKey,