fix: Fix the issue of terminal key connection exception (#10318)

This commit is contained in:
ssongliu 2025-09-09 17:54:45 +08:00 committed by GitHub
parent 2258ba108d
commit 1fc0f1c71b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -6,6 +6,7 @@ import (
"time"
"github.com/1Panel-dev/1Panel/agent/app/dto"
"github.com/1Panel-dev/1Panel/agent/app/model"
"github.com/1Panel-dev/1Panel/agent/buserr"
"github.com/1Panel-dev/1Panel/agent/constant"
"github.com/1Panel-dev/1Panel/agent/utils/encrypt"
@ -113,6 +114,8 @@ func (u *SettingService) SaveConnInfo(req dto.SSHConnData) error {
}
defer client.Close()
var connItem model.LocalConnInfo
_ = copier.Copy(&connItem, &req)
localConn, _ := json.Marshal(&connInfo)
connAfterEncrypt, _ := encrypt.StringEncrypt(string(localConn))
_ = settingRepo.Update("LocalSSHConn", connAfterEncrypt)

View file

@ -94,8 +94,8 @@ const search = async () => {
form.port = res.data.port;
form.authMode = res.data.authMode;
form.password = Base64.decode(res.data.password);
form.privateKey = res.data.privateKey;
form.passPhrase = res.data.passPhrase;
form.privateKey = Base64.decode(res.data.privateKey);
form.passPhrase = Base64.decode(res.data.passPhrase);
}
});
};