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) { var downloadContract = function (projectName) {
// console.log(window.location.href); // console.log(window.location.href);
var url; let url;
if (window.location.href.indexOf("/SCIDE") != -1) if (global.urlparam) {
url = window.location.href.replace("/OnlineIDE.html", "/CMManager?"); if (location.href.startsWith("https")) {
else url = "https://";
url = window.location.href.replace("/OnlineIDE.html", } else {
"/SCIDE/CMManager?"); 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=" var arg = "action=downloadContract&projectName="
arg += projectName; arg += projectName;
var isPrivate = $("#privateprojecttab").hasClass("active"); var isPrivate = $("#privateprojecttab").hasClass("active");