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

去除额外不需要的参数

This commit is contained in:
wenzl
2017-10-25 18:05:00 +08:00
parent 5e47b6e8c3
commit a6af57464f
2 changed files with 17 additions and 24 deletions

View File

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