fix duplicate import pubkey

This commit is contained in:
CaiHQ 2022-12-13 10:38:24 +08:00
parent 949572c5c3
commit 222b254f07

View File

@ -49,9 +49,15 @@ var initVue = function () {
newKey.id = this.sm2KeyList.length;
newKey.title = headerVue.shortName;
newKey.sm2Key = this.sm2KeyStr;
this.sm2KeyList.push(newKey);
var exist = false;
for (var i=0;i<this.sm2KeyList.length;i++){
var iterKey = this.sm2KeyList[i];
if (iterKey.sm2Key==newKey.sm2Key)
exist = true;
}
if (!exist)
this.sm2KeyList.push(newKey);
localStorage.setItem("PrivKeyList", JSON.stringify(this.sm2KeyList));
getSession();
listProjects("priv");
}