fixed:切换角色功能适配新版gorm
This commit is contained in:
@@ -106,7 +106,7 @@ func (userService *UserService) SetUserAuthority(id uint, authorityId uint) (err
|
||||
if errors.Is(assignErr, gorm.ErrRecordNotFound) {
|
||||
return errors.New("该用户无此角色")
|
||||
}
|
||||
err = global.GVA_DB.Where("id = ?", id).First(&system.SysUser{}).Update("authority_id", authorityId).Error
|
||||
err = global.GVA_DB.Model(&system.SysUser{}).Where("id = ?", id).Update("authority_id", authorityId).Error
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user