In the present study, we constructed an electrochemical sensor using three materials, namely, cerium dioxide (CeO2) composite platinum (Pt) and polymer 3-amino-5-mercapto-1,2,4-triazole (PTA), prepared by hydrothermal method, to detect xanthines and uric acid. Scanning electron microscopy (SEM), X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS), and Fourier infrared spectroscopy (FT-IR) were used to characterize the morphology, elemental composition, and structure of materials. The results demonstrated that the PTA/CeO2@Pt composites were prepared. The electrochemical behavior of xanthines and uric acid on PTA/CeO2@Pt composite electrodes was assessed by cyclic voltammetry (CV) and differential pulsed voltammetry (DPV). The results demonstrated that the dropping amount was 20 µL under a phosphoric acid buffer solution (pH 6). The peak current of xanthine (XA) demonstrated two good linear relationships with concentration, the linear regression equation was IXA = 0.3265CXA + 8.1967 R2 = 0.994 in the concentration range of 10–138 µmol/L, whereas it was IXA = 3.9884CXA + 51.661 R2 = 0.992 in the concentration range of 139–330 µmol/L. The detection limit was 10.36 × 10–7 M. The freshness of fish meat was evaluated, and the correlation analysis between evaluation results and results of xanthine detection in fish meat by PTA/CeO2@Pt electrochemical sensor demonstrated that r = 0.945 and P < 0.01 had a good correlation. The sensor could be used to determine the xanthine content in fish to reflect the freshness of fish, thus displaying good application prospects.