完善私钥验证

This commit is contained in:
dushixiang
2020-12-25 03:43:15 +08:00
parent 72f7dd5dc6
commit 6c7cb6b0e7
13 changed files with 203 additions and 70 deletions

View File

@ -1,9 +1,9 @@
package api
import (
"github.com/labstack/echo/v4"
"next-terminal/pkg/model"
"next-terminal/pkg/utils"
"github.com/labstack/echo/v4"
"strconv"
"strings"
)
@ -51,6 +51,21 @@ func AssetUpdateEndpoint(c echo.Context) error {
if err := c.Bind(&item); err != nil {
return err
}
switch item.AccountType {
case "credential":
item.Username = "-"
item.Password = "-"
item.PrivateKey = "-"
item.Passphrase = "-"
case "private-key":
item.Username = "-"
item.Password = "-"
item.CredentialId = "-"
case "custom":
item.PrivateKey = "-"
item.Passphrase = "-"
item.CredentialId = "-"
}
model.UpdateAssetById(&item, id)