- 注释掉老user与auth相关的代码
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
@@ -11,12 +12,28 @@ import (
|
||||
_ "git.rosy.net.cn/jx-callback/business/auth2/authprovider/mobile" // 强制导入mobile认证方式
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/password"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/auth"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
func GetComposedCode(c *beego.Controller, code string) (composedCode string) {
|
||||
composedCode = code
|
||||
referer := c.Ctx.Request.Referer()
|
||||
globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer)
|
||||
index := strings.Index(referer, "//")
|
||||
if index > 0 {
|
||||
list := strings.Split(referer[index+2:], "/")
|
||||
if len(list) >= 2 {
|
||||
composedCode = strings.Join([]string{
|
||||
list[1],
|
||||
code,
|
||||
}, ",")
|
||||
}
|
||||
}
|
||||
return composedCode
|
||||
}
|
||||
|
||||
type Auth2Controller struct {
|
||||
beego.Controller
|
||||
}
|
||||
@@ -84,10 +101,10 @@ func (c *Auth2Controller) Login() {
|
||||
// @router /GetTokenInfo [get]
|
||||
func (c *Auth2Controller) GetTokenInfo() {
|
||||
c.callGetTokenInfo(func(params *tAuth2GetTokenInfoParams) (retVal interface{}, errCode string, err error) {
|
||||
if auth2.IsV2Token(params.Token) {
|
||||
if true { //auth2.IsV2Token(params.Token) {
|
||||
retVal, err = auth2.GetTokenInfo(params.Token)
|
||||
} else {
|
||||
retVal, err = auth.GetUserInfo(params.Token)
|
||||
// retVal, err = auth.GetUserInfo(params.Token)
|
||||
}
|
||||
if err == model.ErrTokenIsInvalid {
|
||||
errCode = model.ErrCodeTokenIsInvalid
|
||||
@@ -214,7 +231,7 @@ func (c *Auth2Controller) Logout() {
|
||||
if authInfo, ok := params.Ctx.GetLoginInfo().(*auth2.AuthInfo); ok {
|
||||
err = auth2.Logout(authInfo)
|
||||
} else {
|
||||
err = auth.Logout(params.Token)
|
||||
// err = auth.Logout(params.Token)
|
||||
}
|
||||
return nil, "", err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user