wxlogin
This commit is contained in:
@@ -7,8 +7,6 @@ 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"
|
||||
@@ -80,14 +78,25 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAu
|
||||
} else if dao.IsNoRowsError(err) { // 直接找不到,尝试unionID
|
||||
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 {
|
||||
globals.SugarLogger.Debugf("dao.IsNoRowsError err=%v", err)
|
||||
return nil, err
|
||||
}
|
||||
if len(authBindList) > 0 { // 通过unionID找到至少一个认证方式
|
||||
//authBindList, err = dao.GetUserBindAuthInfo(db, "", model.AuthBindTypeAuth, unionAuthTypeList, openID, unionID, nil)
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//if len(authBindList) > 0 { // 通过unionID找到至少一个认证方式
|
||||
// authBind = authBindList[0]
|
||||
// authBind.Type = curAuthType
|
||||
// authBind.TypeID = curAuthTypeID
|
||||
// authBind.AuthID = openID
|
||||
// if authDetail != nil {
|
||||
// authBind.DetailData = string(utils.MustMarshal(authDetail))
|
||||
// }
|
||||
// authBindEx = &auth2.AuthBindEx{
|
||||
// AuthBind: *authBind,
|
||||
// }
|
||||
// a.UnbindAuth(authBind.UserID, curAuthType, curAuthTypeID, model.AdminName)
|
||||
// err = a.AddAuthBind(authBindEx, model.AdminName) // 自动绑定
|
||||
//}
|
||||
if authBindList, err = dao.GetUserBindAuthInfo(db, "", model.AuthBindTypeAuth, unionAuthTypeList, openID, unionID, nil); err == nil && len(authBindList) > 0 { // 通过unionID找到至少一个认证方式
|
||||
authBind = authBindList[0]
|
||||
authBind.Type = curAuthType
|
||||
authBind.TypeID = curAuthTypeID
|
||||
|
||||
Reference in New Issue
Block a user