fix: face login
This commit is contained in:
@@ -32,10 +32,10 @@ func NewFaceLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FaceLog
|
||||
}
|
||||
|
||||
type faceLoginResult struct {
|
||||
AccessToken string `json:"access_token"`
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
AccessToken string `json:"access_token"`
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
Info jsoniter.RawMessage `json:"info"`
|
||||
Status int `json:"status"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
func (l *FaceLoginLogic) FaceLogin(in *analysis.FaceLoginReq) (*analysis.Response, error) {
|
||||
@@ -43,11 +43,11 @@ func (l *FaceLoginLogic) FaceLogin(in *analysis.FaceLoginReq) (*analysis.Respons
|
||||
if msg := validate.ValidateFromProto(in, &req); msg != utils.StringEmpty {
|
||||
return common.OutResponse(utils.ErrorParams, msg), nil
|
||||
}
|
||||
if len(req.File) == utils.NumberZero && req.FilePath == utils.StringEmpty {
|
||||
if len(req.File) == utils.NumberZero {
|
||||
return common.FailResponse(utils.ErrorFileUpFailed), nil
|
||||
}
|
||||
|
||||
imgPath, cleanup, err := face.PrepareImagePath(req.File, req.FilePath)
|
||||
imgPath, cleanup, err := face.PrepareImagePath(req.File, utils.StringEmpty)
|
||||
if err != nil {
|
||||
l.Errorf("face login prepare image: %v", err)
|
||||
return common.FailResponse(utils.ErrorFileUpFailed), nil
|
||||
@@ -66,10 +66,6 @@ func (l *FaceLoginLogic) FaceLogin(in *analysis.FaceLoginReq) (*analysis.Respons
|
||||
return common.FailResponse(utils.ErrorFaceNotMatch), nil
|
||||
}
|
||||
|
||||
clientCode := req.ClientCode
|
||||
if clientCode == utils.StringEmpty {
|
||||
clientCode = dao.ClientCodeUserSkin
|
||||
}
|
||||
if l.svcCtx.UserSvcName == utils.StringEmpty {
|
||||
return common.FailResponse(utils.Fail), nil
|
||||
}
|
||||
@@ -80,7 +76,7 @@ func (l *FaceLoginLogic) FaceLogin(in *analysis.FaceLoginReq) (*analysis.Respons
|
||||
}
|
||||
token, err := userpb.NewUserClient(cli.Conn()).InternalLoginByUserId(l.ctx, &userpb.InternalLoginByUserIdReq{
|
||||
UserId: userID,
|
||||
ClientCode: clientCode,
|
||||
ClientCode: dao.ClientCodeUserSkin,
|
||||
})
|
||||
if err != nil {
|
||||
l.Errorf("face login issue token: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user