This commit is contained in:
邹宗楠
2022-10-22 22:44:39 +08:00
parent 04f1190953
commit 5a47102894
37 changed files with 4 additions and 115 deletions

View File

@@ -24,7 +24,6 @@ import (
func GetComposedCode(c *web.Controller, code string) (composedCode string) {
composedCode = code
referer := c.Ctx.Request.Referer()
globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer)
index := strings.Index(referer, "//")
if index > 0 {
list := strings.Split(referer[index+2:], "/")
@@ -38,7 +37,6 @@ func GetComposedCode(c *web.Controller, code string) (composedCode string) {
func GetComposedCode2(c *web.Controller, code string) (composedCode string) {
composedCode = code
referer := c.Ctx.Request.UserAgent()
globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer)
index := strings.Index(referer, "//")
if index > 0 {
list := strings.Split(referer[index+2:], "/")
@@ -133,17 +131,14 @@ func (c *Auth2Controller) Login() {
params.AuthSecret = GetComposedCode2(&c.Controller, params.AuthSecret)
}
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
globals.SugarLogger.Debug("params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret==============", params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret)
authInfo, err := auth2.Login(ctx, params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret)
// TODO 兼容没有取到authid2的错误
if err == nil && authInfo.AuthBindInfo != nil {
if authInfo.AuthBindInfo.AuthID2 == "" {
globals.SugarLogger.Debug("fgfggggggg")
authInfo.AuthBindInfo.AuthID2 = authInfo.AuthBindInfo.AuthID
}
retVal = authInfo
}
globals.SugarLogger.Debug("retVal==============", retVal)
return retVal, "", err
})
}
@@ -248,7 +243,6 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
redirectURL = fmt.Sprintf("%s?info=%s", params.Block, base64.StdEncoding.EncodeToString(utils.MustMarshal(callResult)))
return retVal, model.ErrorCodeIgnore, err
})
globals.SugarLogger.Debugf("WeixinMPOAuth2, callResult:%s, redirectURL:%s", utils.Format4Output(callResult, true), redirectURL)
c.Redirect(redirectURL, http.StatusTemporaryRedirect)
}
@@ -289,7 +283,6 @@ func (c *Auth2Controller) DingDingOAuth2() {
}
return retVal, model.ErrorCodeIgnore, err
})
globals.SugarLogger.Debugf("DingDingOAuth2, callResult:%s, redirectURL:%s", utils.Format4Output(callResult, true), redirectURL)
if redirectURL != "" {
c.Redirect(redirectURL, http.StatusTemporaryRedirect)
}