输出与UnbindAuth相关的调试信息
This commit is contained in:
@@ -288,6 +288,7 @@ func BindUser(inauthInfo *AuthInfo, user IUser) (outauthInfo *AuthInfo, err erro
|
|||||||
|
|
||||||
// 添加新绑定
|
// 添加新绑定
|
||||||
func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
||||||
|
globals.SugarLogger.Debugf("AddAuthBind user:%s, newAuthInfo:%s", utils.Format4Output(user, true), utils.Format4Output(newAuthInfo, true))
|
||||||
if user == nil || newAuthInfo == nil {
|
if user == nil || newAuthInfo == nil {
|
||||||
return ErrInternalErrror
|
return ErrInternalErrror
|
||||||
}
|
}
|
||||||
@@ -312,6 +313,7 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UnbindAuth(userID, authType, userName string) (err error) {
|
func UnbindAuth(userID, authType, userName string) (err error) {
|
||||||
|
globals.SugarLogger.Debugf("UnbindAuth userID:%s, authType:%s, userName:%s", userID, authType, userName)
|
||||||
if handler := authers[authType]; handler != nil {
|
if handler := authers[authType]; handler != nil {
|
||||||
err = handler.UnbindAuth(userID, authType, userName)
|
err = handler.UnbindAuth(userID, authType, userName)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ func (a *DefAuther) AddAuthBind(authBindEx *auth2.AuthBindEx, userName string) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *DefAuther) UnbindAuth(userID, authType, userName string) (err error) {
|
func (a *DefAuther) UnbindAuth(userID, authType, userName string) (err error) {
|
||||||
|
globals.SugarLogger.Debugf("DefAuther.UnbindAuth userID:%s, authType:%s, userName:%s", userID, authType, userName)
|
||||||
_, err = dao.DeleteEntityLogically(nil, &model.AuthBind{}, nil, userName, map[string]interface{}{
|
_, err = dao.DeleteEntityLogically(nil, &model.AuthBind{}, nil, userName, map[string]interface{}{
|
||||||
"UserID": userID,
|
"UserID": userID,
|
||||||
"Type": authType,
|
"Type": authType,
|
||||||
@@ -59,6 +60,8 @@ func (a *DefAuther) GetUserType() (userType int8) {
|
|||||||
|
|
||||||
// 此函数用于联合(通过unionID)查找用户
|
// 此函数用于联合(通过unionID)查找用户
|
||||||
func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []string, openID, unionID string, authDetail interface{}) (authBindEx *auth2.AuthBindEx, err error) {
|
func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []string, openID, unionID string, authDetail interface{}) (authBindEx *auth2.AuthBindEx, err error) {
|
||||||
|
globals.SugarLogger.Debugf("UnionFindAuthBind curAuthType:%s, unionAuthTypeList:%v, openID:%s, unionID:%s, authDetail:%s",
|
||||||
|
curAuthType, unionAuthTypeList, openID, unionID, utils.Format4Output(authDetail, true))
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
var authBind *model.AuthBind
|
var authBind *model.AuthBind
|
||||||
if authBind, err = dao.GetAuthBind(db, model.AuthBindTypeAuth, curAuthType, openID); err == nil { // 直接找到了
|
if authBind, err = dao.GetAuthBind(db, model.AuthBindTypeAuth, curAuthType, openID); err == nil { // 直接找到了
|
||||||
|
|||||||
Reference in New Issue
Block a user