merge: merge changes in BaaS
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user