添加快手登录
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)
|
||||
|
||||
@@ -200,6 +200,10 @@ fnCode = "uDEyAmTbrfS2qjYbgi20Jm"
|
||||
fnMerchantId= "51658"
|
||||
fnCallbackURL = "http://callback.jxc4.com/fn/msg"
|
||||
|
||||
# 快手授权地址
|
||||
kuaiShouAppId = "ks680887971696897880"
|
||||
kuaiShouAppSecret = "1wShCPqUzhg8W1vcb8OdvA"
|
||||
|
||||
#uu跑腿
|
||||
uuAppID="55c4542ae60e4d348edcfc93b06dd302"
|
||||
uuAppKey="76b362c06b1b4baa9e47bab6387a5356"
|
||||
@@ -343,6 +347,10 @@ fnCode = "uDEyAmTbrfS2qjYbgi20Jm"
|
||||
fnMerchantId= "51658"
|
||||
fnCallbackURL = "http://callback.jxc4.com/fn/msg"
|
||||
|
||||
# 快手授权地址
|
||||
kuaiShouAppId = "ks680887971696897880"
|
||||
kuaiShouAppSecret = "1wShCPqUzhg8W1vcb8OdvA"
|
||||
|
||||
#uu跑腿
|
||||
uuAppID="55c4542ae60e4d348edcfc93b06dd302"
|
||||
uuAppKey="76b362c06b1b4baa9e47bab6387a5356"
|
||||
@@ -456,6 +464,11 @@ fnAppSecret = "a8248088-a742-4c33-a0db-03aeae00ca7d"
|
||||
fnMerchantId = "51658"
|
||||
fnCode = "uDEyAmTbrfS2qjYbgi20Jm"
|
||||
fnCallbackURL = "http://callback-jxgy.jxc4.com/fn/msg"
|
||||
|
||||
# 快手授权地址
|
||||
kuaiShouAppId = "ks680887971696897880"
|
||||
kuaiShouAppSecret = "1wShCPqUzhg8W1vcb8OdvA"
|
||||
|
||||
#uu跑腿
|
||||
uuAppID="55c4542ae60e4d348edcfc93b06dd302"
|
||||
uuAppKey="76b362c06b1b4baa9e47bab6387a5356"
|
||||
@@ -654,6 +667,11 @@ fnAppSecret = "c1e6c280-e618-4103-9d0a-673bc54fb22e"
|
||||
fnCode = "uDEyAmTbrfS2qjYbgi20Jm"
|
||||
fnMerchantId= "51658"
|
||||
fnCallbackURL = "http://callback.jxc4.com/fn/msg"
|
||||
|
||||
# 快手授权地址
|
||||
kuaiShouAppId = "ks680887971696897880"
|
||||
kuaiShouAppSecret = "1wShCPqUzhg8W1vcb8OdvA"
|
||||
|
||||
#uu跑腿
|
||||
uuAppID="55c4542ae60e4d348edcfc93b06dd302"
|
||||
uuAppKey="76b362c06b1b4baa9e47bab6387a5356"
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/ali_logistics_query"
|
||||
enterprise "git.rosy.net.cn/baseapi/platformapi/enterprise_wechat"
|
||||
"git.rosy.net.cn/baseapi/platformapi/jxprintapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/kuaishou_mini"
|
||||
"git.rosy.net.cn/baseapi/platformapi/qywxapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tiktok"
|
||||
tiktokShop "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
@@ -125,6 +126,7 @@ var (
|
||||
EnterpriseChatMin *enterprise.API // 企业微信小程序api
|
||||
|
||||
LogisticsApi *ali_logistics_query.API // 阿里云提供获取物流订单的配送信息
|
||||
KuaiShouApi *kuaishou_mini.API // 快手平台
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -320,4 +322,5 @@ func Init() {
|
||||
TiktokStore = tiktokShop.New(beego.AppConfig.DefaultString("tiktokShopAppId", ""), beego.AppConfig.DefaultString("tiktokShopAppSecret", ""), "")
|
||||
EnterpriseChatHeadApi = enterprise.New("ww9a156bfa070e1857", "0jBdCjSmoFiOoHIXyeCK9VbGQ82fVNJZ8uMl6JNN7X4") // 通讯录
|
||||
EnterpriseChatMin = enterprise.NewMin("ww9a156bfa070e1857", "JQsEmSTltHhNgdPIT320YJFphiYmRs-YZa-rCBwplss") // 小程序
|
||||
KuaiShouApi = kuaishou_mini.New(beego.AppConfig.DefaultString("kuaiShouAppSecret", ""), beego.AppConfig.DefaultString("kuaiShouAppId", ""))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user