Merge branch 'develop' of git.ailuowan.com:zzw/lone-services into develop
CI / changes (push) Successful in 2m0s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / aiserver (push) Successful in 0s
CI / analysis (push) Successful in 0s
CI / bff (push) Successful in 0s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 1s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 0s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 0s
CI / percutaneous (push) Successful in 1s
CI / product (push) Successful in 0s
CI / record (push) Successful in 1s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 1s
CI / support (push) Successful in 0s
CI / task (push) Successful in 1s
CI / user (push) Successful in 0s
CI / water (push) Successful in 30s
CI / wecom (push) Successful in 0s
CI / ws (push) Successful in 0s
CI / changes (push) Successful in 2m0s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / aiserver (push) Successful in 0s
CI / analysis (push) Successful in 0s
CI / bff (push) Successful in 0s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 1s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 0s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 0s
CI / percutaneous (push) Successful in 1s
CI / product (push) Successful in 0s
CI / record (push) Successful in 1s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 1s
CI / support (push) Successful in 0s
CI / task (push) Successful in 1s
CI / user (push) Successful in 0s
CI / water (push) Successful in 30s
CI / wecom (push) Successful in 0s
CI / ws (push) Successful in 0s
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)
|
||||
|
||||
@@ -29,15 +29,13 @@ func (p FaceBindValidator) GetMessage() validate.ValidatorMessages {
|
||||
}
|
||||
|
||||
type FaceLoginValidator struct {
|
||||
File []byte
|
||||
FilePath string `validate:"omitempty,max=512"`
|
||||
ClientCode string `validate:"omitempty,max=32"`
|
||||
File []byte `validate:"required,min=1"`
|
||||
}
|
||||
|
||||
func (p FaceLoginValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"FilePath.max": "file_path 过长",
|
||||
"ClientCode.max": "client_code 过长",
|
||||
"File.required": "file 必传",
|
||||
"File.min": "file 必传",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user