Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
@@ -79,7 +81,10 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAu
|
|||||||
if unionID != "" || openID != "" { // 且有unionID
|
if unionID != "" || openID != "" { // 且有unionID
|
||||||
var authBindList []*model.AuthBind
|
var authBindList []*model.AuthBind
|
||||||
authBindList, err = dao.GetUserBindAuthInfo(db, "", model.AuthBindTypeAuth, unionAuthTypeList, openID, unionID, nil)
|
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 {
|
if err != nil {
|
||||||
|
globals.SugarLogger.Debugf("dao.IsNoRowsError err=%v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if len(authBindList) > 0 { // 通过unionID找到至少一个认证方式
|
if len(authBindList) > 0 { // 通过unionID找到至少一个认证方式
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package weixin
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
@@ -73,8 +72,8 @@ func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx,
|
|||||||
state := id
|
state := id
|
||||||
code := jsCode
|
code := jsCode
|
||||||
if state == "" {
|
if state == "" {
|
||||||
temp := a.getAPI()
|
//temp := a.getAPI()
|
||||||
fmt.Printf("secret=%s,appid=%s", temp.GetSecret(), temp.GetAppID())
|
//fmt.Printf("secret=%s,appid=%s", temp.GetSecret(), temp.GetAppID())
|
||||||
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
openID = token.OpenID
|
openID = token.OpenID
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package dao
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetAuthBind(db *DaoDB, bindType int, authType, authID string) (authBind *model.AuthBind, err error) {
|
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)
|
sqlParams = append(sqlParams, typeIDs)
|
||||||
}
|
}
|
||||||
sql += " ORDER BY t1.type"
|
sql += " ORDER BY t1.type"
|
||||||
|
globals.SugarLogger.Debugf("GetUserBindAuthInfo sql=%s,sqlParams=%s", sql, utils.Format4Output(sqlParams, false))
|
||||||
err = GetRows(db, &authList, sql, sqlParams...)
|
err = GetRows(db, &authList, sql, sqlParams...)
|
||||||
return authList, err
|
return authList, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user