100
This commit is contained in:
@@ -4,43 +4,6 @@ import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
// OauthAccessTokenResData access_token
|
||||
type OauthAccessTokenResData struct {
|
||||
ErrorCode int64 `json:"error_code"` // 错误码
|
||||
ExpiresIn uint64 `json:"expires_in"` // access_token接口调用凭证超时时间,单位(秒)
|
||||
OpenId string `json:"open_id"` // 授权用户唯一标识
|
||||
RefreshExpiresIn int64 `json:"refresh_expires_in"` // refresh_token凭证超时时间,单位(秒)
|
||||
RefreshToken string `json:"refresh_token"` // 用户刷新access_token
|
||||
Scope string `json:"scope"` // 用户授权的作用域(Scope),使用逗号(,)分隔,开放平台几乎几乎每个接口都需要特定的Scope。
|
||||
AccessToken string `json:"access_token"` // 接口调用凭证
|
||||
Description string `json:"description"` // 错误码描述
|
||||
}
|
||||
|
||||
// DYError 错误结构体
|
||||
type DYError struct {
|
||||
ErrorCode int64 `json:"error_code,omitempty"` // 错误码
|
||||
Description string `json:"description,omitempty"` // 错误码描述
|
||||
}
|
||||
|
||||
// OauthAccessTokenRes access_token
|
||||
type OauthAccessTokenRes struct {
|
||||
Data *OauthAccessTokenResData
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// 抖音登录返回值
|
||||
type TiktokOauthResone struct {
|
||||
ErrNo int64 `json:"err_no"`
|
||||
ErrTips string `json:"err_tips"`
|
||||
Data *struct {
|
||||
SessionKey string `json:"session_key"`
|
||||
OpenId string `json:"openid"` // 授权用户唯一标识
|
||||
AnonymousOpenid string `json:"anonymous_openid"`
|
||||
Unionid string `json:"unionid"`
|
||||
Dopenid string `json:"dopenid"`
|
||||
}
|
||||
}
|
||||
|
||||
// 获取抖音登录授权2
|
||||
func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
|
||||
tokenReq := make(map[string]interface{}, 3)
|
||||
|
||||
Reference in New Issue
Block a user