This paper investigates the degree of influence of the gravitational field of dark matter on the laws of motion of bodies in a medium in a restricted two-body problem, when a test body (planet, asteroid, artificial satellite of a star, in particular, the Sun, etc.) has its own rotation, i. e. own angular momentum impulse. The study was carried out within the framework of the post-Newtonian approximation of the general theory of relativity. In accordance with the latest experimental data, hypotheses about the average densities of dark matter ρD.M. and visible matter ρvis. in planetary systems are accepted. In particular, in the Solar system the following is accepted: ρD.M ≈ 2,8 · 10–19 g · cm–3, ρvis ≈ 3 · 10–20 g · cm–3 and ρΣ = ρvis + ρD.M ≈ 3,1 · 10–19 g · cm–3. In the post-Newtonian approximation of the general theory of relativity, the equation for the trajectory of a rotating test body with respect to ρΣ is derived, and working formulas are obtained that give the laws of secular changes in the direction of the vector of the proper angular momentum impulse of the test body and the modulus of this vector. It is shown that accounting ρD.M changes the magnitude of the periastron shift. For example, in the Solar System when taking into account ρvis, all the planets except Pluto have a directly shifted perihelion in the post-Newtonian approximation of the general theory of relativity. When taking into account ρΣ the planets from Mercury to Saturn included, they have a direct shift of perihelion, and Uranus, Neptune, Pluto have the reverse (against the planets in orbit). There is also a secular change in the eccentricity of the orbit. The formula is derived that can be used to calculate the secular deviation of the translational motion of a rotating body from motion in a plane. Accounting ρΣ enhances deviation. It is emphasized that all the noted effects for planetary systems in the vicinity of neutron stars, radio pulsars and other dense objects can be many orders of magnitude greater than in the solar system.