diff --git a/server/handlers/pve.go b/server/handlers/pve.go index 1d79e6d..7e1fc68 100644 --- a/server/handlers/pve.go +++ b/server/handlers/pve.go @@ -67,6 +67,7 @@ func (h *PVEHandler) Get(c *gin.Context) { } host.PasswordEnc = "" + host.Password = "" c.JSON(http.StatusOK, host) } @@ -98,6 +99,7 @@ func (h *PVEHandler) Create(c *gin.Context) { } host.PasswordEnc = "" + host.Password = "" c.JSON(http.StatusCreated, host) } diff --git a/server/models/models.go b/server/models/models.go index 047f28c..e6b731a 100644 --- a/server/models/models.go +++ b/server/models/models.go @@ -142,7 +142,7 @@ type PVEHost struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // 运行时使用,不存储 - Password string `json:"-"` + Password string `json:"password"` } type PVEVMStatus struct {