POST api/Account/wxLogin

微信登录/注册(用户先绑定才能使用微信登录)

Request Information

URI Parameters

None.

Body Parameters

WeChatUser
NameDescriptionTypeAdditional information
subscribe

用户是否订阅该公众号标识,值为0时,代表此用户没有关注该公众号,拉取不到其余信息。

integer

None.

openid

用户的唯一标识

string

None.

nickname

用户昵称

string

None.

gender

用户的性别,值为1时是男性,值为2时是女性,值为0时是未知

integer

None.

province

用户个人资料填写的省份

string

None.

city

普通用户个人资料填写的城市

string

None.

country

国家,如中国为CN

string

None.

headimgurl

用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空

string

None.

avatarUrl

string

None.

privilege

用户特权信息,json 数组,如微信沃卡用户为(chinaunicom) 作者注:其实这个格式称不上JSON,只是个单纯数组。

Collection of string

None.

unionid

string

None.

Request Formats

application/json, text/json

Sample:
{
  "subscribe": 1,
  "openid": "sample string 2",
  "nickname": "sample string 3",
  "gender": 4,
  "province": "sample string 5",
  "city": "sample string 6",
  "country": "sample string 7",
  "headimgurl": "sample string 8",
  "avatarUrl": "sample string 9",
  "privilege": [
    "sample string 1",
    "sample string 2"
  ],
  "unionid": "sample string 10"
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'WeChatUser'.

Response Information

Resource Description

微信登录/注册(用户先绑定才能使用微信登录)

IHttpActionResult

None.

Response Formats

application/json, text/json

Sample:

Sample not available.