This commit is contained in:
Mrx
2026-02-04 13:33:21 +08:00
parent e7c2ddbd93
commit e1fbf72437
23 changed files with 190 additions and 65 deletions

View File

@@ -2,9 +2,9 @@ package user
import (
"context"
"time"
"tydata-server/common/ctxdata"
"tydata-server/common/xerr"
"time"
"github.com/pkg/errors"
@@ -35,6 +35,10 @@ func (l *GetTokenLogic) GetToken() (resp *types.MobileCodeLoginResp, err error)
}
token, err := l.svcCtx.UserService.GeneralUserToken(l.ctx, claims.UserId, claims.UserType)
if err != nil {
causeErr := errors.Cause(err)
if _, ok := causeErr.(*xerr.CodeError); ok {
return nil, err
}
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "用户信息, %v", err)
}
// 获取当前时间戳