添加快手登录
This commit is contained in:
@@ -1,50 +1,41 @@
|
||||
package kuaishou
|
||||
|
||||
//
|
||||
//import (
|
||||
// "git.rosy.net.cn/baseapi/platformapi/tiktok"
|
||||
// "git.rosy.net.cn/baseapi/platformapi/weixinapi"
|
||||
// "git.rosy.net.cn/jx-callback/business/auth2"
|
||||
// "git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||
// "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
// "git.rosy.net.cn/jx-callback/business/model"
|
||||
// "git.rosy.net.cn/jx-callback/globals"
|
||||
// "git.rosy.net.cn/jx-callback/globals/api"
|
||||
// "strings"
|
||||
//)
|
||||
//
|
||||
//const (
|
||||
// AuthTypeKuaiShouMini = "kuaishoumini" // 快手小程序
|
||||
//)
|
||||
//
|
||||
//type KuaiShouMiniAuther struct {
|
||||
// authprovider.DefAuther
|
||||
//}
|
||||
//
|
||||
//var (
|
||||
// AutherObjMini *KuaiShouMiniAuther
|
||||
//)
|
||||
//
|
||||
//func init() {
|
||||
// AutherObjMini = new(KuaiShouMiniAuther)
|
||||
// auth2.RegisterAuther(AuthTypeKuaiShouMini, AutherObjMini)
|
||||
//}
|
||||
//
|
||||
//func (a *KuaiShouMiniAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||
// //appID, realCode := splitCode(code)
|
||||
// //sessionInfo, err := getTikTokApp(appID).GetTiktokOauth(realCode)
|
||||
// sessionInfo, err := api.TiktokApi.GetTiktokOauth(code)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// sessionKey := sessionInfo.Data.SessionKey
|
||||
// if authBindEx, err = a.UnionFindAuthBind(AuthTypeKuaiShouMini, api.TiktokApi.GetAppID(), []string{AuthTypeKuaiShouMini}, sessionInfo.Data.OpenId, sessionInfo.Data.Unionid, sessionInfo); err == nil {
|
||||
// authBindEx.UserData = sessionKey
|
||||
// }
|
||||
// return authBindEx, err
|
||||
//}
|
||||
//
|
||||
//// 特殊接口
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
const (
|
||||
AuthTypeKuaiShouMini = "kuaishoumini" // 快手小程序
|
||||
)
|
||||
|
||||
type KuaiShouMiniAuther struct {
|
||||
authprovider.DefAuther
|
||||
}
|
||||
|
||||
var (
|
||||
AutherObjMini *KuaiShouMiniAuther
|
||||
)
|
||||
|
||||
func init() {
|
||||
AutherObjMini = new(KuaiShouMiniAuther)
|
||||
auth2.RegisterAuther(AuthTypeKuaiShouMini, AutherObjMini)
|
||||
}
|
||||
|
||||
func (a *KuaiShouMiniAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||
//appID, realCode := splitCode(code)
|
||||
//sessionInfo, err := getTikTokApp(appID).GetTiktokOauth(realCode)
|
||||
sessionInfo, openId, err := api.KuaiShouApi.AuthLoginKuaiShou(code)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if authBindEx, err = a.UnionFindAuthBind(AuthTypeKuaiShouMini, api.KuaiShouApi.GetAppID(), []string{AuthTypeKuaiShouMini}, openId, "", sessionInfo); err == nil {
|
||||
authBindEx.UserData = sessionInfo
|
||||
}
|
||||
return authBindEx, err
|
||||
}
|
||||
|
||||
//func (a *KuaiShouMiniAuther) DecryptData(authInfo *auth2.AuthInfo, jsCode, encryptedData, iv string) (decryptedDataBase64 string, err error) {
|
||||
// var sessionKey string
|
||||
// appID, jsCode := weixin.SplitJsCode(jsCode)
|
||||
|
||||
Reference in New Issue
Block a user