fix: fix downloadContract in BaaS

This commit is contained in:
Frank.R.Wu 2021-06-17 00:08:42 +08:00
parent e09d11ea2c
commit 14960c3df2

View File

@ -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");