diff --git a/js/onlineide/leftmenu.js b/js/onlineide/leftmenu.js index f3c766f..40f1541 100644 --- a/js/onlineide/leftmenu.js +++ b/js/onlineide/leftmenu.js @@ -721,13 +721,21 @@ var cancelUpload = function () { } var downloadContract = function (projectName) { // console.log(window.location.href); - var url; - if (window.location.href.indexOf("/SCIDE") != -1) - url = window.location.href.replace("/OnlineIDE.html", "/CMManager?"); - else - url = window.location.href.replace("/OnlineIDE.html", - "/SCIDE/CMManager?"); - + let url; + if (global.urlparam) { + if (location.href.startsWith("https")) { + url = "https://"; + } else { + url = "http://"; + } + url += `${global.urlparam.nodeAddr}/SCIDE/CMManager?`; + } else { + if (window.location.href.indexOf("/SCIDE") != -1) + url = window.location.href.replace("/OnlineIDE.html", "/CMManager?"); + else + url = window.location.href.replace("/OnlineIDE.html", + "/SCIDE/CMManager?"); + } var arg = "action=downloadContract&projectName=" arg += projectName; var isPrivate = $("#privateprojecttab").hasClass("active");