Skip to content

Commit

Permalink
feat: 支持修改用户名
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Nov 30, 2024
1 parent 44aded4 commit f629344
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/dashboard/controller/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions model/user_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit f629344

Please sign in to comment.