From f62934440d77c3d768b54ed25ebae3b5fedfc7d8 Mon Sep 17 00:00:00 2001 From: naiba Date: Sat, 30 Nov 2024 15:05:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- cmd/dashboard/controller/user.go | 1 + model/user_api.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f65d325..9496634 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: - uses: robinraju/release-downloader@v1 with: repository: nezhahq/admin-frontend - tag: v1.0.6 + tag: v1.0.7 fileName: dist.zip latest: true extract: true diff --git a/cmd/dashboard/controller/user.go b/cmd/dashboard/controller/user.go index 08e40ee..2edd68b 100644 --- a/cmd/dashboard/controller/user.go +++ b/cmd/dashboard/controller/user.go @@ -62,6 +62,7 @@ func updateProfile(c *gin.Context) (any, error) { return nil, err } + user.Username = pf.NewUsername user.Password = string(hash) if err := singleton.DB.Save(&user).Error; err != nil { return nil, newGormError("%v", err) diff --git a/model/user_api.go b/model/user_api.go index 05c62e0..c8df8a3 100644 --- a/model/user_api.go +++ b/model/user_api.go @@ -7,5 +7,6 @@ type UserForm struct { type ProfileForm struct { OriginalPassword string `json:"original_password,omitempty"` + NewUsername string `json:"new_username,omitempty"` NewPassword string `json:"new_password,omitempty"` }