diff --git a/business/auth2/authprovider/weixin/weixin.go b/business/auth2/authprovider/weixin/weixin.go index 443e8d09e..78dd31315 100644 --- a/business/auth2/authprovider/weixin/weixin.go +++ b/business/auth2/authprovider/weixin/weixin.go @@ -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 diff --git a/controllers/auth2.go b/controllers/auth2.go index fe5e489be..73ec0e679 100644 --- a/controllers/auth2.go +++ b/controllers/auth2.go @@ -3,6 +3,7 @@ package controllers import ( "encoding/base64" "fmt" + "git.rosy.net.cn/jx-callback/globals" "net/http" "strings" @@ -131,6 +132,7 @@ func (c *Auth2Controller) Login() { params.AuthSecret = GetComposedCode2(&c.Controller, params.AuthSecret) } ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request) + globals.SugarLogger.Debugf("======参数login === %s", utils.Format4Output(params, false)) authInfo, err := auth2.Login(ctx, params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret) // TODO 兼容没有取到authid2的错误 if err == nil && authInfo.AuthBindInfo != nil {