fix duplicate import pubkey
This commit is contained in:
parent
949572c5c3
commit
222b254f07
@ -49,9 +49,15 @@ var initVue = function () {
|
|||||||
newKey.id = this.sm2KeyList.length;
|
newKey.id = this.sm2KeyList.length;
|
||||||
newKey.title = headerVue.shortName;
|
newKey.title = headerVue.shortName;
|
||||||
newKey.sm2Key = this.sm2KeyStr;
|
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));
|
localStorage.setItem("PrivKeyList", JSON.stringify(this.sm2KeyList));
|
||||||
|
|
||||||
getSession();
|
getSession();
|
||||||
listProjects("priv");
|
listProjects("priv");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user