merge: merge changes in BaaS
This commit is contained in:
@@ -156,7 +156,7 @@ function onSessionID(data) {
|
||||
const loginParam = {
|
||||
action: "login",
|
||||
pubKey: global.sm2Key.publicKey,
|
||||
signature: sm2.doSignature(global.session, global.sm2Key.privateKey,{hash:true,der:true})
|
||||
signature: sm2.doSignature(global.session, global.sm2Key.privateKey, {hash: true, der: true})
|
||||
};
|
||||
global.wssocket.send(JSON.stringify(loginParam));
|
||||
}
|
||||
@@ -309,10 +309,10 @@ function onListContractProcess(data) {
|
||||
|
||||
mainVue.contracts = [];
|
||||
var list = JSON.parse(data.data);
|
||||
for (var i=0;i<list.length;i++){
|
||||
if (list[i].contractStatus != "KILLED"){
|
||||
mainVue.contracts.push(list[i]);
|
||||
}
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if (list[i].contractStatus != "KILLED") {
|
||||
mainVue.contracts.push(list[i]);
|
||||
}
|
||||
}
|
||||
selectedContract.value = 0;
|
||||
selectContractToExecute();
|
||||
@@ -359,11 +359,11 @@ function onExecuteResult(obj) {
|
||||
const data = obj;
|
||||
$("#executeResultTitle")
|
||||
.html(data.status + " (" + obj.executeTime + "ms) 未知格式");
|
||||
if (data.result instanceof Object){
|
||||
if (data.result instanceof Object) {
|
||||
$("#executeResultTitle")
|
||||
.html(data.status + " (" + obj.executeTime + "ms) JSON格式");
|
||||
global.responseEditor.setValue(JSON.stringify(data.result));
|
||||
} else if (typeof data.result == 'string'){
|
||||
} else if (typeof data.result == 'string') {
|
||||
$("#executeResultTitle")
|
||||
.html(data.status + " (" + obj.executeTime + "ms) 字符串格式");
|
||||
global.responseEditor.setValue(data.result);
|
||||
@@ -394,7 +394,7 @@ function onExecuteResult(obj) {
|
||||
|
||||
function onGenerateReadme(obj) {
|
||||
// console.log(obj.data);
|
||||
myToast("生成文档结果",obj.data);
|
||||
myToast("生成文档结果", obj.data);
|
||||
}
|
||||
|
||||
function onHashResult(obj) {
|
||||
@@ -460,8 +460,9 @@ function showDialog(title, cb, cancelcb) {
|
||||
|
||||
function init() {
|
||||
console.log("[nodecenterManagement.js] init : ");
|
||||
const urlParams = getRequestParameters();
|
||||
initVue();
|
||||
initGlobal();
|
||||
initGlobal(urlParams);
|
||||
initWSocket();
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
const scriptEditor = $("#scriptEditor");
|
||||
@@ -474,17 +475,40 @@ function init() {
|
||||
lineWrapping: true
|
||||
});
|
||||
global.scriptEditor.setSize("height", height);
|
||||
|
||||
}
|
||||
|
||||
function getRequestParameters() {
|
||||
let arr = (location.search || "").replace(/^\?/, '').split("&");
|
||||
let params = {};
|
||||
for (let sd of arr) {
|
||||
let data = sd.split("=");
|
||||
if (data.length === 2) {
|
||||
params[data[0]] = data[1];
|
||||
if (location.href.indexOf("/BaaSOnlineIDE.html") !== -1) {
|
||||
let params = location.href.replace(/[^#]*(#(\/)?|\?)/, '')
|
||||
let url = location.href.replace(params, '')
|
||||
while (!params) {
|
||||
url = url.replace(/(#(\/)?|\?)$/, '')
|
||||
params = url.replace(/[^#]*(#(\/)?|\?)/, '')
|
||||
url = url.replace(params, '')
|
||||
}
|
||||
if (url.endsWith('#') || url.endsWith('#\/')) {
|
||||
let sKey = Math.random().toString()
|
||||
localStorage.setItem(sKey, params)
|
||||
location.href = url.replace(/#(\/)?/, '?' + sKey)
|
||||
} else {
|
||||
let json = atob(localStorage.getItem(params))
|
||||
try {
|
||||
return JSON.parse(json);
|
||||
} catch (e) {
|
||||
localStorage.removeItem(params)
|
||||
alert('链接失效!')
|
||||
location.href = location.origin
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let arr = (location.search || "").replace(/^\?/, '').split("&");
|
||||
let params = {};
|
||||
for (let sd of arr) {
|
||||
let data = sd.split("=");
|
||||
if (data.length === 2) {
|
||||
params[data[0]] = data[1];
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
return params;
|
||||
}
|
||||
Reference in New Issue
Block a user