fix: gorm fields && syncUserinfo dubplicate insertion
This commit is contained in:
@@ -53,7 +53,7 @@ func (srv Service) PublishEvent(ctx context.Context, subject string, message int
|
||||
return nil
|
||||
}
|
||||
|
||||
func (srv Service) GetAuthCodeURL(ctx context.Context, req *pb.GetCodeURLRequest) (*pb.GetCodeURLResponse, error) {
|
||||
func (srv Service) GetCodeURL(ctx context.Context, req *pb.GetCodeURLRequest) (*pb.GetCodeURLResponse, error) {
|
||||
resp := srv.client.GetCodeURL(req.RedirectUrl, req.State, mpauth.Scope(req.Scope.String()))
|
||||
|
||||
return &pb.GetCodeURLResponse{
|
||||
@@ -163,7 +163,7 @@ func (srv Service) SyncUserinfo(ctx context.Context, req *pb.SyncUserinfoRequest
|
||||
return nil, status.Errorf(codes.Internal, errors.Wrap(err, "get userinfo token from weixin failed").Error())
|
||||
}
|
||||
|
||||
userinfo = Userinfo{Userinfo: *resp}
|
||||
userinfo.Userinfo = *resp
|
||||
if err := srv.db.Save(&userinfo).Error; err != nil {
|
||||
return nil, status.Errorf(codes.Internal, errors.Wrap(err, "sync userinfo and save to database failed").Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user