作者 yangfu

日志添加

package mobile_client
import (
"github.com/linmadan/egglib-go/utils/json"
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type baseController struct {
... ... @@ -39,8 +41,11 @@ func (controller *baseController) GetOrgId() int64 {
func (controller *baseController) GetOperator() domain.Operator {
token := controller.Ctx.Input.Header("X-Mmm-Accesstoken")
loginToken := &domain.LoginToken{}
loginToken.ParseToken(token)
return domain.Operator{
err := loginToken.ParseToken(token)
if err != nil {
log.Logger.Error(err.Error())
}
op := domain.Operator{
UserId: loginToken.UserId,
CompanyId: loginToken.CompanyId,
OrgId: loginToken.OrgId,
... ... @@ -48,4 +53,7 @@ func (controller *baseController) GetOperator() domain.Operator {
Phone: loginToken.Account,
Token: token,
}
// TODO:打印测试日志
log.Logger.Debug("operator " + json.MarshalToString(op))
return op
}
... ...