This commit is contained in:
邹宗楠
2023-01-31 09:16:28 +08:00
parent 63687148fb
commit c3c7c7ddbd
2 changed files with 9 additions and 2 deletions

View File

@@ -2,6 +2,8 @@ package weixin
import (
"errors"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
"git.rosy.net.cn/jx-callback/business/auth2"
@@ -14,7 +16,7 @@ const (
AuthTypeWeixin = "wxqrcode" // 微信扫码
AuthTypeMP = "weixinsns" // 公众号
AuthTypeWXNative = "wxnative" // 微信APP
AuthTypeWxApp = "weixinapp" //app微信登录
AuthTypeWxApp = "weixinapp" //app微信登录()
)
type Auther struct {
@@ -57,7 +59,10 @@ func init() {
func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx, err error) {
var openID, accessToken string
_, jsCode := SplitJsCode(secret)
appId, jsCode := SplitJsCode(secret)
globals.SugarLogger.Debugf("=======appId := %s ,jscode := %s", appId, jsCode)
globals.SugarLogger.Debugf("auther := %s", utils.Format4Output(a.authType, false))
globals.SugarLogger.Debugf("auther := %s", utils.Format4Output(a.DefAuther, false))
if a.authType != AuthTypeWXNative {
state := id
code := jsCode