|
|
package controllers
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"github.com/linmadan/egglib-go/web/beego"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/auth/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/auth/service"
|
...
|
...
|
@@ -75,16 +74,19 @@ func (controller *AuthController) RefreshToken() { |
|
|
func (controller *AuthController) UserInfos() {
|
|
|
tokenStr := controller.Ctx.Input.Header("x-mmm-accesstoken")
|
|
|
if tokenStr == "" { //没有带token
|
|
|
controller.Response(nil, errors.New("token 错误"))
|
|
|
e := application.ThrowError(application.ARG_ERROR, "token 错误")
|
|
|
controller.Response(nil, e)
|
|
|
return
|
|
|
}
|
|
|
userAuth, err := (&domain.UserAuth{}).ParseAccessToken(tokenStr)
|
|
|
if err != nil || userAuth.UserId <= 0 {
|
|
|
controller.Response(nil, errors.New("token 错误"))
|
|
|
e := application.ThrowError(application.ARG_ERROR, "token 错误")
|
|
|
controller.Response(nil, e)
|
|
|
return
|
|
|
}
|
|
|
if userAuth.PlatformId != constant.PLATFORM_FONT_ID {
|
|
|
controller.Response(nil, errors.New("token 错误"))
|
|
|
e := application.ThrowError(application.ARG_ERROR, "token 错误")
|
|
|
controller.Response(nil, e)
|
|
|
return
|
|
|
}
|
|
|
authService := &service.AuthService{}
|
...
|
...
|
|