🎨 改进数据仓库密钥导入校验

This commit is contained in:
Liang Ding 2022-07-14 11:24:33 +08:00
parent 0afaf36e81
commit 27aebe9041
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 8 additions and 0 deletions

View file

@ -83,6 +83,10 @@ func ImportRepoKey(base64Key string) (err error) {
util.LogErrorf("import data repo key failed: %s", err)
return errors.New(Conf.Language(157))
}
if 32 != len(key) {
return errors.New(Conf.Language(157))
}
Conf.Repo.Key = key
Conf.Save()
@ -429,6 +433,7 @@ func syncRepo(boot, exit, byHand bool) {
msg := Conf.Language(26)
util.PushStatusBar(msg)
util.PushErrMsg(msg, 0)
planSyncAfter(30 * time.Second)
return
}