feat: init; from commit c3adcb2e6bc94b46f4f34c03bc62abcce6c7e1a0 of BDContract
This commit is contained in:
37
js/ncconfig.js
Executable file
37
js/ncconfig.js
Executable file
@@ -0,0 +1,37 @@
|
||||
var loadConfig = function() {
|
||||
listLicence();
|
||||
};
|
||||
var listLicence = function() {
|
||||
var arg = {};
|
||||
arg.action = "listLicence";
|
||||
global.wssocket.send(JSON.stringify(arg));
|
||||
};
|
||||
var onListLicence = function(obj) {
|
||||
mainVue.licenceNodes = obj.nodeCount;
|
||||
mainVue.licenceDueDate = obj.dueDate;
|
||||
};
|
||||
var downloadUUID = function() {
|
||||
var nonce = global.session;
|
||||
var pubKey = global.sm2Key.publicKey;
|
||||
var signature = sm2.doSignature(global.session, global.sm2Key.privateKey);
|
||||
window.open("./NodeCenter?action=downloadUUID&sign=" + signature
|
||||
+ "&pubKey=" + pubKey + "&nonce=" + nonce);
|
||||
};
|
||||
var updateLicence = function() {
|
||||
var req = {};
|
||||
req.action = "updateLicence";
|
||||
try {
|
||||
var content = mainVue.offlineLicence;
|
||||
var contents = content.split("|");
|
||||
req.sign = contents[1];
|
||||
req.content = contents[0];
|
||||
if (req.sign == undefined || req.content == undefined) {
|
||||
myToast("手动提交Licence", "失败,Licence格式错误");
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
myToast("手动提交Licence", "失败,Licence格式错误");
|
||||
return;
|
||||
}
|
||||
global.wssocket.send(JSON.stringify(req));
|
||||
};
|
||||
Reference in New Issue
Block a user