Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/service/system/sys_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func (userService *UserService) SetUserInfo(req system.SysUser) error {
func (userService *UserService) SetSelfInfo(req system.SysUser) error {
return global.GVA_DB.Model(&system.SysUser{}).
Where("id=?", req.ID).
Select("HeaderImg", "NickName").
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field names in the Select clause should use snake_case to match database column names ('header_img', 'nick_name') instead of struct field names. Looking at SetUserInfo (line 232), it correctly uses snake_case field names. This inconsistency may cause the update to fail or not work as intended.

Suggested change
Select("HeaderImg", "NickName").
Select("header_img", "nick_name").

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation detected. The Select line uses spaces instead of tabs, which is inconsistent with the surrounding code style (lines 251-252, 254 use tabs).

Suggested change
Select("HeaderImg", "NickName").
Select("HeaderImg", "NickName").

Copilot uses AI. Check for mistakes.
Updates(req).Error
}

Expand Down
Loading