1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-12 08:42:28 +08:00

Merge pull request #49 from silenceper/develop

fix oauth.Redirect 缺少request
This commit is contained in:
silenceper
2018-01-29 14:45:26 +08:00
committed by GitHub

View File

@@ -38,13 +38,12 @@ func (oauth *Oauth) GetRedirectURL(redirectURI, scope, state string) (string, er
} }
//Redirect 跳转到网页授权 //Redirect 跳转到网页授权
func (oauth *Oauth) Redirect(writer http.ResponseWriter, redirectURI, scope, state string) error { func (oauth *Oauth) Redirect(writer http.ResponseWriter, req *http.Request, redirectURI, scope, state string) error {
location, err := oauth.GetRedirectURL(redirectURI, scope, state) location, err := oauth.GetRedirectURL(redirectURI, scope, state)
if err != nil { if err != nil {
return err return err
} }
//location 为完整地址所以不需要request http.Redirect(writer, req, location, 302)
http.Redirect(writer, nil, location, 302)
return nil return nil
} }