In order to prepare a coating with better corrosion resistance, the double‐layer coatings are designed to work together in this article. The double‐layer coatings are made of polyethersulfone and epoxy resin as the matrix resin. Polyaniline (PANI) of different contents was added to the matrix resin by weight to form the primer coats, which was named as d‐0, d‐20, d‐40, d‐60. And polytetrafluoroethylene was introduced into the matrix resin to prepare the surface coats. A two‐layer coating was prepared by coating the surface layer on the primer layer, named as S‐0, S‐20, S‐40, S‐60. The surface morphology of the primer coatings and the cross section morphology of the two‐layer coatings were determined by field emission scanning electron microscopy. The anticorrosion property of the coatings was studied by water absorption, adhesion, salt spray corrosion acceleration test and electrochemical impedance test. The results indicate that the 40 wt% PANI composite coating shows the best corrosion resistance.