...
|
...
|
@@ -159,8 +159,13 @@ func CheckToken(ctx *context.Context) (result bool) { |
|
|
var (
|
|
|
msg *protocol.ResponseMessage
|
|
|
)
|
|
|
if strings.HasSuffix(ctx.Request.RequestURI, "login") {
|
|
|
return true
|
|
|
token := ctx.Input.Header("x-mmm-accesstoken")
|
|
|
if token==""{
|
|
|
if strings.HasSuffix(ctx.Request.RequestURI, "login") ||
|
|
|
strings.HasSuffix(ctx.Request.RequestURI, "accessToken") ||
|
|
|
strings.HasSuffix(ctx.Request.RequestURI, "refreshToken") {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
result = true
|
|
|
defer func() {
|
...
|
...
|
@@ -169,7 +174,6 @@ func CheckToken(ctx *context.Context) (result bool) { |
|
|
ctx.Output.JSON(msg, false, false)
|
|
|
}
|
|
|
}()
|
|
|
token := ctx.Input.Header("x-mmm-accesstoken")
|
|
|
if rsp, err := auth.CheckToken(&protocol.CheckTokenRequest{Token: token}); err != nil || rsp.UserInfo == nil {
|
|
|
msg = protocol.NewReturnResponse(rsp, err)
|
|
|
log.Error(fmt.Sprintf("%v req:%v resp:%v", ctx.Request.RequestURI, token, common.AssertJson(msg)))
|
...
|
...
|
|