Identification and quantification of epigoitrin (EP) in some herbs and traditional Chinese medicine (TCM) preparations are critical to pharmacokinetic study and pharmaceutical quality control due to their distinct antiviral pharmacological activity. Developing an efficient, sensitive, rapid method for determination of EP is therefore essential for clinical treatment and drug development. Here, a novel molecularly imprinted electrochemical sensor for determination of EP was constructed using double-layered membranes consisting of polyaniline functionalized graphene oxide with excellent electrochemical performance and molecularly imprinted polymers on surface of electrode. The follow-up constructed polyacrylamide (PAM) films afford several specific binding cavities, endowing the exclusive recognition ability. Moreover, the PAM chain is anchored to the PANI chain by covalent bonds, and the sensitivity is further improved. Under optimized conditions, the sensor demonstrated good linearity over a wide range of 4.6×10-7 mol/L ~ 4.6×10-5 mol/L with a low detection limit of 8.21×10-8 mol/L (S/N = 3). Additionally, the sensor showed good repeatability, stability and selectivity, and can be used for the detection of EP in the extraction from Isatidis Radix with a recovery of 97.8% above. This work also provided a novel strategy for on-site, real-time and rapid detection of indicator components from TCM.