From c26804a4dda4f384745d2d41cff5a8a4f493f9a7 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Mon, 3 Jul 2023 17:47:09 +0800 Subject: [PATCH 1/3] wxlogin --- business/auth2/authprovider/defauther.go | 4 ++++ business/auth2/authprovider/weixin/weixin.go | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/business/auth2/authprovider/defauther.go b/business/auth2/authprovider/defauther.go index 119600db6..c77f91333 100644 --- a/business/auth2/authprovider/defauther.go +++ b/business/auth2/authprovider/defauther.go @@ -7,6 +7,8 @@ import ( "strings" "time" + "git.rosy.net.cn/jx-callback/globals" + "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/auth2" "git.rosy.net.cn/jx-callback/business/model" @@ -79,6 +81,8 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAu if unionID != "" || openID != "" { // 且有unionID var authBindList []*model.AuthBind authBindList, err = dao.GetUserBindAuthInfo(db, "", model.AuthBindTypeAuth, unionAuthTypeList, openID, unionID, nil) + globals.SugarLogger.Debugf("dao.IsNoRowsError authBindList=%s", utils.Format4Output(authBindList, false)) + globals.SugarLogger.Debugf("dao.IsNoRowsError openID=%s, unionID=%s", openID, unionID) if err != nil { return nil, err } diff --git a/business/auth2/authprovider/weixin/weixin.go b/business/auth2/authprovider/weixin/weixin.go index 32e60bb22..f773c78dd 100644 --- a/business/auth2/authprovider/weixin/weixin.go +++ b/business/auth2/authprovider/weixin/weixin.go @@ -2,7 +2,6 @@ package weixin import ( "errors" - "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" @@ -73,8 +72,8 @@ func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx, state := id code := jsCode if state == "" { - temp := a.getAPI() - fmt.Printf("secret=%s,appid=%s", temp.GetSecret(), temp.GetAppID()) + //temp := a.getAPI() + //fmt.Printf("secret=%s,appid=%s", temp.GetSecret(), temp.GetAppID()) token, err2 := a.getAPI().SNSRetrieveToken(code) if err = err2; err == nil { openID = token.OpenID From 57ed7d8e4aef508d57ecff0793bfdfa8d0906535 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Mon, 3 Jul 2023 17:52:39 +0800 Subject: [PATCH 2/3] wxlogin --- business/auth2/authprovider/defauther.go | 1 + business/model/dao/dao_auth2.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/business/auth2/authprovider/defauther.go b/business/auth2/authprovider/defauther.go index c77f91333..41970abcc 100644 --- a/business/auth2/authprovider/defauther.go +++ b/business/auth2/authprovider/defauther.go @@ -84,6 +84,7 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAu globals.SugarLogger.Debugf("dao.IsNoRowsError authBindList=%s", utils.Format4Output(authBindList, false)) globals.SugarLogger.Debugf("dao.IsNoRowsError openID=%s, unionID=%s", openID, unionID) if err != nil { + globals.SugarLogger.Debugf("dao.IsNoRowsError err=%v", err) return nil, err } if len(authBindList) > 0 { // 通过unionID找到至少一个认证方式 diff --git a/business/model/dao/dao_auth2.go b/business/model/dao/dao_auth2.go index 63f11174b..bb8a79f92 100644 --- a/business/model/dao/dao_auth2.go +++ b/business/model/dao/dao_auth2.go @@ -2,8 +2,10 @@ package dao import ( "errors" + "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/model" + "git.rosy.net.cn/jx-print/globals" ) func GetAuthBind(db *DaoDB, bindType int, authType, authID string) (authBind *model.AuthBind, err error) { @@ -60,6 +62,7 @@ func GetUserBindAuthInfo(db *DaoDB, userID string, bindType int, typeList []stri sqlParams = append(sqlParams, typeIDs) } sql += " ORDER BY t1.type" + globals.SugarLogger.Debugf("GetUserBindAuthInfo sql=%s,sqlParams=%s", sql, utils.Format4Output(sqlParams, false)) err = GetRows(db, &authList, sql, sqlParams...) return authList, err } From f172617e452d262a527e8752305759d7eb0b3a16 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Mon, 3 Jul 2023 17:59:25 +0800 Subject: [PATCH 3/3] wxlogin --- business/model/dao/dao_auth2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/dao/dao_auth2.go b/business/model/dao/dao_auth2.go index bb8a79f92..09cf76cd4 100644 --- a/business/model/dao/dao_auth2.go +++ b/business/model/dao/dao_auth2.go @@ -5,7 +5,7 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/model" - "git.rosy.net.cn/jx-print/globals" + "git.rosy.net.cn/jx-callback/globals" ) func GetAuthBind(db *DaoDB, bindType int, authType, authID string) (authBind *model.AuthBind, err error) {