merge: merge changes in BaaS

This commit is contained in:
Frank.R.Wu
2021-06-15 21:43:19 +08:00
parent c8758ecfdc
commit 12a1b701f7
7 changed files with 2166 additions and 1409 deletions

View File

@@ -3,7 +3,7 @@ function getDateDaysBefore(daysAgo) {
return new Date(dateStr).getTime() - daysAgo * 24 * 3600 * 1000;
}
const primaryColor = "#2E324C";
let primaryColor = "#2E324C";
// ======Vue start
let headerVue = "";
@@ -41,11 +41,17 @@ function initVue() {
if (!sm2Key.publicKey || !sm2Key.privateKey) {
this.sm2KeyStr = (JSON.stringify(global.sm2Key));
} else {
if (sm2Key.publicKey.search("\\.") != -1 || sm2Key.publicKey.search("\\.\\.") != -1 || sm2Key.publicKey.search("/") != -1 || sm2Key.publicKey.search("\\\\") != -1) {
if (sm2Key.publicKey.search("\\.") !== -1 ||
sm2Key.publicKey.search("\\.\\.") !== -1 ||
sm2Key.publicKey.search("/") !== -1 ||
sm2Key.publicKey.search("\\\\") !== -1) {
myToast("导入失败", "不是合法的公钥!");
return;
}
if (sm2Key.privateKey.search("\\.") != -1 || sm2Key.privateKey.search("\\.\\.") != -1 || sm2Key.privateKey.search("/") != -1 || sm2Key.privateKey.search("\\\\") != -1) {
if (sm2Key.privateKey.search("\\.") !== -1 ||
sm2Key.privateKey.search("\\.\\.") !== -1 ||
sm2Key.privateKey.search("/") !== -1 ||
sm2Key.privateKey.search("\\\\") !== -1) {
myToast("导入失败", "不是合法的私钥!");
return;
}
@@ -194,14 +200,23 @@ function initVue() {
// ======Vue done
function initGlobal() {
function initGlobal(urlParams) {
window.global = {};
global.sm2Key = localStorage.getItem("PrivKey");
global.result = "";
if (!global.sm2Key || global.sm2Key.length < 100) {
generate();
if (location.href.indexOf("/BaaSOnlineIDE.html") !== -1) {
global.isBaaS = true
primaryColor = "#08263a"
}
if (urlParams) {
global.urlparam = urlParams
global.sm2Key = urlParams.keys
} else {
global.sm2Key = JSON.parse(global.sm2Key);
global.sm2Key = localStorage.getItem("PrivKey");
if (!global.sm2Key || global.sm2Key.length < 100) {
generate();
} else {
global.sm2Key = JSON.parse(global.sm2Key);
}
}
headerVue.shortName = global.sm2Key.publicKey.substr(0, 5);
pubkeyDialogVue.sm2KeyStr = JSON.stringify(global.sm2Key);