diff --git a/routers/authentication/wechat.go b/routers/authentication/wechat.go index 2b11f1d86..72871afb3 100644 --- a/routers/authentication/wechat.go +++ b/routers/authentication/wechat.go @@ -35,10 +35,7 @@ func GetQRCode4Bind(ctx *context.Context) { }) return } - redirectUrl := ctx.Query("redirect_to") - if redirectUrl != "" { - ctx.SetCookie("redirect_to", setting.AppSubURL+redirectUrl, 0, setting.AppSubURL) - } + ctx.JSON(200, map[string]interface{}{ "code": "00", "msg": "success", @@ -90,7 +87,10 @@ func GetBindPage(ctx *context.Context) { if r != nil { ctx.Data["qrcode"] = r } - + redirectUrl := ctx.Query("redirect_to") + if redirectUrl != "" { + ctx.SetCookie("redirect_to", setting.AppSubURL+redirectUrl, 0, setting.AppSubURL) + } ctx.HTML(200, tplBindPage) }