In this study, gold nanoclusters (AuNCs) were encapsulated in a metal-organic frame ZIF-8 based on the aggregation-induced luminescence effect (AIE), ratio fluorescent probes with strong orange fluorescence (AuNCs@ZIF-8) were successfully synthesized. The structural features of ZIF-8 were used to constrain the spin motion of GSH@AuNCs to trigger the AIE effect, thus improving the fluorescence performance of GSH@AuNCs. The fluorescence of AuNCs@ZIF-8 was significantly enhanced by 6.25-fold compared to GSH@AuNCs and had dual emission wavelengths at 420 nm and 600 nm. When it reacted with enrofloxacin (ENRO), there was a significant fluorescence enhancement at 420 nm, while the emission wavelength at 600 nm remained unchanged. On this basis, a ratiometric fluorescence sensor was constructed to detect ENRO in animal-derived food. The self-calibration function was provided by using two emission wavelengths of the ratio fluorescent probe, and more reliable sensing results were achieved by recording different fluorescence emission signals of two channels. In the range of 0.1 to 100 μg/L, the fluorescence response value (F420/F600) followed the ENRO concentration, and the limit of detection (LOD, S/N = 3) was 0.935 μg/L. Meanwhile, by detecting ENRO in egg, chicken, milk and shrimp samples, the sample recovery rate was 90.95 %-104.09 % and CV was 0.74 %-9.82 %, so it can be used as an effective strategy to monitor ENRO residues in animal-derived foods.