From 6fd60ac8a3474d8ed806dbebc36c01503838c76b Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 24 Feb 2022 10:14:00 +0800 Subject: [PATCH] #1494 update redirect --- routers/authentication/wechat.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) }