- redirect added.
This commit is contained in:
@@ -3,10 +3,10 @@ package controllers
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/weixin"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
@@ -32,7 +32,6 @@ func (c *WeiXinController) GetUserInfo() {
|
||||
code := c.GetString("code")
|
||||
block := c.GetString("block")
|
||||
state := c.GetString("state")
|
||||
str := ""
|
||||
if block != "" {
|
||||
if code != "" {
|
||||
result, err2 := weixin.GetUserInfo(code, state)
|
||||
@@ -46,9 +45,8 @@ func (c *WeiXinController) GetUserInfo() {
|
||||
} else {
|
||||
retVal.Msg = "code为空"
|
||||
}
|
||||
c.Ctx.Output.Header("Location", fmt.Sprintf("%s?info=%s", block, base64.StdEncoding.EncodeToString(utils.MustMarshal(retVal))))
|
||||
} else {
|
||||
str = "没有block"
|
||||
retVal.Msg = "没有block"
|
||||
}
|
||||
globals.SugarLogger.Debug(str)
|
||||
c.Redirect(fmt.Sprintf("%s?info=%s", block, base64.StdEncoding.EncodeToString(utils.MustMarshal(retVal))), http.StatusTemporaryRedirect)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user