支持登录类型wxnative

This commit is contained in:
gazebo
2020-01-17 15:21:26 +08:00
parent a27f261ca4
commit 0fffdfdd76
3 changed files with 42 additions and 20 deletions

View File

@@ -13,6 +13,10 @@ import (
"git.rosy.net.cn/jx-callback/globals/api"
)
const (
AuthTypeMini = "weixinmini" // 小程序
)
type MiniAuther struct {
authprovider.DefAuther
}
@@ -37,7 +41,7 @@ func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthB
if err == nil {
sessionKey := sessionInfo.SessionKey
sessionInfo.SessionKey = ""
if authBindEx, err = a.UnionFindAuthBind(AuthTypeMini, []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini}, sessionInfo.OpenID, sessionInfo.UnionID, sessionInfo); err == nil {
if authBindEx, err = a.UnionFindAuthBind(AuthTypeMini, []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini, AuthTypeWXNative}, sessionInfo.OpenID, sessionInfo.UnionID, sessionInfo); err == nil {
authBindEx.UserData = sessionKey
}
}