Skip to content

微信小程序授权登录

接口地址:/v2/enduser/enduserapi/wechatMiniprogramAuthLogin

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

微信小程序授权登录

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
appId小程序appIdquerytruestring
jsCode登录时获取的codequerytruestring
signature签名
签名生成规则:SHA256(appId + jsCode+userDomainSecret)
querytruestring
userDomain用户域querytruestring
mccMCCqueryfalseinteger(int32)

响应状态:

状态码说明schema
200登录成功,data 中返回 token返回注册码响应数据«登录返回的 token»
5013用户域格式不正确
5015用户域不存在
5023请输入用户域
5104用户域已停用
5218请输入appid
5367获取用户OpenID请求异常
5368获取用户OpenID失败
5369解析用户OpenID失败
5372请输入jsCode
5373企业未配置该小程序Secret
6084MCC不属于当前数据中心
6085查询MCC的数据中心失败

响应参数:

参数名称参数说明类型schema
code响应状态码integer(int32)integer(int32)
data响应数据登录返回的 token登录返回的 token
  accessToken接口访问 tokentokentoken
    expirationTime到期时间的时间戳,单位为秒。超过到期时间后,token 失效。integer
    tokentokenstring
  refreshToken刷新 tokentokentoken
    expirationTime到期时间的时间戳,单位为秒。超过到期时间后,token 失效。integer
    tokentokenstring
extMsg扩展消息string
msg响应消息string

响应示例:

javascript
{
	"code": 0,
	"data": {
		"accessToken": {
			"expirationTime": 0,
			"token": ""
		},
		"refreshToken": {
			"expirationTime": 0,
			"token": ""
		}
	},
	"extMsg": "",
	"msg": ""
}