From c9abd0052bcc9eb853354d3d203d190980039fa4 Mon Sep 17 00:00:00 2001 From: runzexia Date: Thu, 9 May 2019 18:13:54 +0800 Subject: [PATCH] do not need get id Signed-off-by: runzexia --- pkg/models/devops/project_credential_handler.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/models/devops/project_credential_handler.go b/pkg/models/devops/project_credential_handler.go index 86ff42728..b844bec88 100644 --- a/pkg/models/devops/project_credential_handler.go +++ b/pkg/models/devops/project_credential_handler.go @@ -303,11 +303,6 @@ func GetProjectCredential(projectId, credentialId, domain, getContent string) (* value := selection.Text() content.Content = value }) - - doc.Find("input[name*=id][type=text]").Each(func(i int, selection *goquery.Selection) { - value, _ := selection.Attr("value") - response.Id = value - }) response.KubeconfigCredential = content case CredentialTypeUsernamePassword: content := &UsernamePasswordCredential{} @@ -316,10 +311,6 @@ func GetProjectCredential(projectId, credentialId, domain, getContent string) (* content.Username = value }) - doc.Find("input[name*=id][type=text]").Each(func(i int, selection *goquery.Selection) { - value, _ := selection.Attr("value") - response.Id = value - }) response.UsernamePasswordCredential = content case CredentialTypeSsh: content := &SshCredential{} @@ -327,11 +318,7 @@ func GetProjectCredential(projectId, credentialId, domain, getContent string) (* value, _ := selection.Attr("value") content.Username = value }) - - doc.Find("input[name*=id][type=text]").Each(func(i int, selection *goquery.Selection) { - value, _ := selection.Attr("value") - response.Id = value - }) + doc.Find("textarea[name*=privateKey]").Each(func(i int, selection *goquery.Selection) { value := selection.Text() content.PrivateKey = value