兼容新抖音小程序
This commit is contained in:
@@ -306,6 +306,7 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
err = ErrIllegalAuthType
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package douyin
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
|
||||
"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"
|
||||
@@ -30,8 +30,8 @@ func init() {
|
||||
|
||||
func (a *TiktopMiniAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||
globals.SugarLogger.Debugf("toktok mini VerifySecret jsCode:%s", code)
|
||||
|
||||
sessionInfo, err := api.TiktokApi.GetTiktokOauth(code)
|
||||
appID, _ := weixin.SplitJsCode(code)
|
||||
sessionInfo, err := getTikTokApp(appID).GetTiktokOauth(code)
|
||||
globals.SugarLogger.Debug("toktok mini VerifySecret sessionInfo:", sessionInfo)
|
||||
if err == nil {
|
||||
sessionKey := sessionInfo.Data.SessionKey
|
||||
@@ -88,3 +88,11 @@ func getWxApp(appID string) (miniApi *weixinapi.API) {
|
||||
}
|
||||
return miniApi
|
||||
}
|
||||
|
||||
func getTikTokApp(appID string) (TikTokMini *tiktok.API) {
|
||||
TikTokMini = api.TiktokApi
|
||||
if len(appID) > 0 && appID == api.TiktokJXDJApiID {
|
||||
TikTokMini = api.TiktokJXDJApi
|
||||
}
|
||||
return TikTokMini
|
||||
}
|
||||
|
||||
@@ -211,7 +211,8 @@ tiktokAppKey = "tta6a1d01c399f264201"
|
||||
tiktokAppSecret = "5c08a0465cf0f996af254a03b6c2548defef87ad"
|
||||
|
||||
tiktokJXDJKey="ttaceeda5333d7a7ab01" #京西到家抖音小程序
|
||||
tiktokJXDJSecret="9285b20dce3c46179204a5aa4d92ca96ee1ed5c9"
|
||||
TiktokJXDJApiID="ttaceeda5333d7a7ab01"
|
||||
tiktokJXDJSecret="5c8492ec2744fb72bb6cc356983f3cfc317f85d4"
|
||||
#国美
|
||||
gomeiAppKey = "N0R033L2QQFR53"
|
||||
gomeiAppSecret = "686ffc3e31c24594838baed045563790"
|
||||
@@ -336,7 +337,8 @@ tiktokAppKey = "tta6a1d01c399f264201"
|
||||
tiktokAppSecret = "5c08a0465cf0f996af254a03b6c2548defef87ad"
|
||||
|
||||
tiktokJXDJKey="ttaceeda5333d7a7ab01" #京西到家抖音小程序
|
||||
tiktokJXDJSecret="9285b20dce3c46179204a5aa4d92ca96ee1ed5c9"
|
||||
TiktokJXDJApiID="ttaceeda5333d7a7ab01"
|
||||
tiktokJXDJSecret="5c8492ec2744fb72bb6cc356983f3cfc317f85d4"
|
||||
#国美
|
||||
gomeiAppKey = "N0R033L2QQFR53"
|
||||
gomeiAppSecret = "686ffc3e31c24594838baed045563790"
|
||||
@@ -441,7 +443,8 @@ tiktokAppKey = "tta6a1d01c399f264201"
|
||||
tiktokAppSecret = "5c08a0465cf0f996af254a03b6c2548defef87ad"
|
||||
|
||||
tiktokJXDJKey="ttaceeda5333d7a7ab01" #京西到家抖音小程序
|
||||
tiktokJXDJSecret="9285b20dce3c46179204a5aa4d92ca96ee1ed5c9"
|
||||
TiktokJXDJApiID="ttaceeda5333d7a7ab01"
|
||||
tiktokJXDJSecret="5c8492ec2744fb72bb6cc356983f3cfc317f85d4"
|
||||
#国美
|
||||
gomeiAppKey = "N0R033L2QQFR53"
|
||||
gomeiAppSecret = "686ffc3e31c24594838baed045563790"
|
||||
@@ -629,7 +632,8 @@ tiktokAppKey = "tta6a1d01c399f264201"
|
||||
tiktokAppSecret = "5c08a0465cf0f996af254a03b6c2548defef87ad"
|
||||
|
||||
tiktokJXDJKey="ttaceeda5333d7a7ab01" #京西到家抖音小程序
|
||||
tiktokJXDJSecret="9285b20dce3c46179204a5aa4d92ca96ee1ed5c9"
|
||||
TiktokJXDJApiID="ttaceeda5333d7a7ab01"
|
||||
tiktokJXDJSecret="5c8492ec2744fb72bb6cc356983f3cfc317f85d4"
|
||||
#国美
|
||||
gomeiAppKey = "N0R033L2QQFR53"
|
||||
gomeiAppSecret = "686ffc3e31c24594838baed045563790"
|
||||
@@ -112,8 +112,11 @@ var (
|
||||
Cacher cache.ICacher
|
||||
SMSClient *aliyunsmsclient.SmsClient
|
||||
|
||||
TiktokApi *tiktok.API // 抖音api
|
||||
GuoMeiApi *gomei.API // 国美api
|
||||
TiktokApi *tiktok.API // 抖音api
|
||||
TiktokJXDJApi *tiktok.API //抖音京西到家api
|
||||
TiktokApiID string //抖音商城ID
|
||||
TiktokJXDJApiID string //抖音京西到家ID
|
||||
GuoMeiApi *gomei.API // 国美api
|
||||
|
||||
EnterpriseChatHeadApi *enterprise.API // 企业微信api
|
||||
EnterpriseChatMin *enterprise.API // 企业微信小程序api
|
||||
|
||||
Reference in New Issue
Block a user