aa
This commit is contained in:
@@ -325,7 +325,6 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
|||||||
return ErrInternalErrror
|
return ErrInternalErrror
|
||||||
}
|
}
|
||||||
if !newAuthInfo.IsUserEmpty() {
|
if !newAuthInfo.IsUserEmpty() {
|
||||||
globals.SugarLogger.Debugf("AddAuthBind user:33333333333333333333333 %v",)
|
|
||||||
return ErrAuthTypeAlreadyExist
|
return ErrAuthTypeAlreadyExist
|
||||||
}
|
}
|
||||||
RemoveUserInfo(newAuthInfo.Token)
|
RemoveUserInfo(newAuthInfo.Token)
|
||||||
@@ -336,12 +335,9 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
|||||||
} else {
|
} else {
|
||||||
if handler := authers[newAuthInfo.AuthBindInfo.Type]; handler != nil {
|
if handler := authers[newAuthInfo.AuthBindInfo.Type]; handler != nil {
|
||||||
newAuthInfo.AuthBindInfo.UserID = user.GetID()
|
newAuthInfo.AuthBindInfo.UserID = user.GetID()
|
||||||
globals.SugarLogger.Debugf("AddAuthBind user:111111111111111111111111111", )
|
|
||||||
handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
||||||
globals.SugarLogger.Debugf("AddAuthBind user:2222222222222222222222222 %v", utils.Format4Output(newAuthInfo.AuthBindInfo,true))
|
|
||||||
err = handler.AddAuthBind(newAuthInfo.AuthBindInfo, user.GetName())
|
err = handler.AddAuthBind(newAuthInfo.AuthBindInfo, user.GetName())
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Debugf("AddAuthBind user:444444444444444444444444", )
|
|
||||||
err = ErrIllegalAuthType
|
err = ErrIllegalAuthType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,11 +208,9 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
|
|||||||
}
|
}
|
||||||
if params.Block != "" {
|
if params.Block != "" {
|
||||||
if moblie := params.Block[strings.LastIndex(params.Block,"=")+1:]; moblie != "" {
|
if moblie := params.Block[strings.LastIndex(params.Block,"=")+1:]; moblie != "" {
|
||||||
fmt.Println("moblie", moblie)
|
|
||||||
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", moblie); err == nil {
|
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", moblie); err == nil {
|
||||||
if user != nil {
|
if user != nil {
|
||||||
authInfo.AuthBindInfo.UserID = user.UserID
|
authInfo.AuthBindInfo.UserID = user.UserID
|
||||||
authInfo.UserID = user.UserID
|
|
||||||
authInfo.AuthBindInfo.AuthBind.UserID = user.UserID
|
authInfo.AuthBindInfo.AuthBind.UserID = user.UserID
|
||||||
auth2.AddAuthBind(user, authInfo)
|
auth2.AddAuthBind(user, authInfo)
|
||||||
} else {
|
} else {
|
||||||
@@ -223,7 +221,6 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
|
|||||||
}
|
}
|
||||||
if strings.Contains(params.Block,"?"){
|
if strings.Contains(params.Block,"?"){
|
||||||
params.Block = params.Block[:strings.LastIndex(params.Block,"?" )]
|
params.Block = params.Block[:strings.LastIndex(params.Block,"?" )]
|
||||||
fmt.Println("params.Block", params.Block)
|
|
||||||
}
|
}
|
||||||
redirectURL = fmt.Sprintf("%s?info=%s", params.Block, base64.StdEncoding.EncodeToString(utils.MustMarshal(callResult)))
|
redirectURL = fmt.Sprintf("%s?info=%s", params.Block, base64.StdEncoding.EncodeToString(utils.MustMarshal(callResult)))
|
||||||
return retVal, model.ErrorCodeIgnore, err
|
return retVal, model.ErrorCodeIgnore, err
|
||||||
|
|||||||
Reference in New Issue
Block a user