g-C3N4and g-C3N4/TCNQ composites with different doping levels were prepared using the copolymerization thermal method with melamine as a precursor. XRD, FT-IR, SEM, TEM, DRS, PL, and I-T characterized them. The composites were successfully prepared in this study. The photocatalytic degradation of pefloxacin (PEF), enrofloxacin (ciprofloxacin), and ciprofloxacin (ciprofloxacin) under visible light (λ > 550 nm) showed that the composite material had the best degradation effect on PEF. When TCNQ doping is 20 mg and catalyst dosage is 50 mg, the catalytic effect is the best, and the degradation rate reaches 91.6%, k = 0.0111 min−1, which is four times that of g-C3N4. Repeated experiments found that the cyclic stability of the g-C3N4/TCNQ composite was good. The XRD images were almost unchanged after five reactions. The radical capture experiments revealed that ·O2−was the main active species in the g-C3N4/TCNQ catalytic system, and h+also played a role in PEF degradation. And the possible mechanism for PEF degradation was speculated.