Skip to content

用户注册时赋值其他属性报错206 #32

Description

@stt106

我在官方文档上看到可以这样注册用户并且赋值用户的其他属性:

func (lc LeanCloudDB) CreatePlayer(name string, password string, points int) (string, error) {
	player, err := lc.client.Users.SignUp(name, password)
	if err != nil {
		panic(err)
	}

	// TODO: why does this NOT work?
	err = lc.client.Users.ID(player.ID).Set("points", points)
	 if err != nil {
	 	panic(err)
	}
	return player.ID, nil
}

但是我这样用却不行: panic: 206 The user cannot be altered by a client without the session.
请问我什么地方用的不对?我是在一个console app里测试时出现这个问题的。用户注册成功了。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions