f
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bdrp-server/app/main/api/internal/svc"
|
||||
"bdrp-server/app/main/api/internal/types"
|
||||
"bdrp-server/app/main/model"
|
||||
"bdrp-server/common/ctxdata"
|
||||
"bdrp-server/common/xerr"
|
||||
"bdrp-server/pkg/lzkit/crypto"
|
||||
"context"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/pkg/errors"
|
||||
@@ -38,6 +38,15 @@ func (l *DetailLogic) Detail() (resp *types.UserInfoResp, err error) {
|
||||
userID := claims.UserId
|
||||
userType := claims.UserType
|
||||
if userType != model.UserTypeNormal {
|
||||
if userType == model.UserTypeTemp {
|
||||
_, err = l.svcCtx.UserTempModel.FindOne(l.ctx, userID)
|
||||
if err != nil {
|
||||
if errors.Is(err, model.ErrNotFound) {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.USER_TEMP_INVALID), "用户信息, 临时用户不存在, %v", err)
|
||||
}
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "用户信息, 查询临时用户失败, %v", err)
|
||||
}
|
||||
}
|
||||
return &types.UserInfoResp{
|
||||
UserInfo: types.User{
|
||||
Id: userID,
|
||||
|
||||
Reference in New Issue
Block a user