This paper aims to study the dynamic modeling and attitude control of a kind of slender flexible spacecraft. The basic structure of this kind of spacecraft is different from the traditional structure of a center rigid body with flexible appendages, but rigid bodies at both ends, which are connected by a flexible truss structure. Firstly, the finite element modeling method is adopted to establish the dynamic model of this kind of spacecraft, and the vibration frequency and damping of the flexible structure are obtained. The unconstrained modes of the flexible spacecraft are obtained through mathematical analysis, finite element analysis and frequency domain analysis. In addition, a nonlinear sliding surface with angular velocity constraint is designed. On this basis, an adaptive sliding mode (ASM) controller is proposed, stability of the close-loop system under the controller is proved, and the dynamic model is verified through mathematical simulation.