The invention discloses an online sampling analysis method of aflatoxin, which comprises the following steps: after the sample extract is filtered and diluted, the filtrate passes through an immunoaffinity column containing aflatoxin specific antibody, and the antibody is compatible with aflatoxin B1, B2 , G1, G2 have specific antigen-antibody binding, so that they are retained on the affinity column, other impurities flow out with the mobile phase, the antigen-antibody bond is broken by heating, and the target compound is eluted with water, and the eluent passes through the fully automatic fungal The toxin pretreatment and online sampling platform injects the sample into the high-performance liquid chromatograph online, and the aflatoxin is fully separated. The target compound is derivatized by a post-column derivatization system and can be detected by a fluorescence detector. Each aflatoxin can be obtained separately accurate quantification. This method breaks the antigen-antibody bond by heating, elutes the target compound with water, avoids the use of organic solvents, and is environmentally friendly; fully automatic operation not only improves the production efficiency and repeatability, but also avoids the operator from contacting the highly toxic aflatoxin Standard.