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