feat: 支持修改用户名
This commit is contained in:
		
							parent
							
								
									44aded493e
								
							
						
					
					
						commit
						f62934440d
					
				
							
								
								
									
										2
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							@ -32,7 +32,7 @@ jobs:
 | 
				
			|||||||
      - uses: robinraju/release-downloader@v1
 | 
					      - uses: robinraju/release-downloader@v1
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          repository: nezhahq/admin-frontend
 | 
					          repository: nezhahq/admin-frontend
 | 
				
			||||||
          tag: v1.0.6
 | 
					          tag: v1.0.7
 | 
				
			||||||
          fileName: dist.zip
 | 
					          fileName: dist.zip
 | 
				
			||||||
          latest: true
 | 
					          latest: true
 | 
				
			||||||
          extract: true
 | 
					          extract: true
 | 
				
			||||||
 | 
				
			|||||||
@ -62,6 +62,7 @@ func updateProfile(c *gin.Context) (any, error) {
 | 
				
			|||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						user.Username = pf.NewUsername
 | 
				
			||||||
	user.Password = string(hash)
 | 
						user.Password = string(hash)
 | 
				
			||||||
	if err := singleton.DB.Save(&user).Error; err != nil {
 | 
						if err := singleton.DB.Save(&user).Error; err != nil {
 | 
				
			||||||
		return nil, newGormError("%v", err)
 | 
							return nil, newGormError("%v", err)
 | 
				
			||||||
 | 
				
			|||||||
@ -7,5 +7,6 @@ type UserForm struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
type ProfileForm struct {
 | 
					type ProfileForm struct {
 | 
				
			||||||
	OriginalPassword string `json:"original_password,omitempty"`
 | 
						OriginalPassword string `json:"original_password,omitempty"`
 | 
				
			||||||
 | 
						NewUsername      string `json:"new_username,omitempty"`
 | 
				
			||||||
	NewPassword      string `json:"new_password,omitempty"`
 | 
						NewPassword      string `json:"new_password,omitempty"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user