|
@@ -30,7 +30,7 @@ const (
|
|
|
)
|
|
|
|
|
|
// Login 用户登录
|
|
|
-func (s *StoreEntry) Login(ctx context.Context, req *pasturePb.SearchUserRequest) (*pasturePb.SystemUserResponse, error) {
|
|
|
+func (s *StoreEntry) Login(ctx context.Context, platform string, req *pasturePb.SearchUserRequest) (*pasturePb.SystemUserResponse, error) {
|
|
|
i18nTemplate, err := s.GetI18nTemplate(ctx)
|
|
|
if err != nil {
|
|
|
return nil, xerr.WithStack(err)
|
|
@@ -116,6 +116,11 @@ func (s *StoreEntry) Login(ctx context.Context, req *pasturePb.SearchUserRequest
|
|
|
roleNameList = append(roleNameList, role.Name)
|
|
|
}
|
|
|
|
|
|
+ userId := int32(0)
|
|
|
+ if platform == "h5" {
|
|
|
+ userId = int32(systemUser.Id)
|
|
|
+ }
|
|
|
+
|
|
|
return &pasturePb.SystemUserResponse{
|
|
|
Code: http.StatusOK,
|
|
|
Msg: "ok",
|
|
@@ -128,6 +133,7 @@ func (s *StoreEntry) Login(ctx context.Context, req *pasturePb.SearchUserRequest
|
|
|
Avatar: systemUser.Avatar,
|
|
|
FarmId: farmList[0].FarmId,
|
|
|
FarmName: farmList[0].Name,
|
|
|
+ UserId: userId,
|
|
|
},
|
|
|
}, nil
|
|
|
}
|