The invention discloses a method for detecting indoleacetic acid and salicylic acid and an electrochemical sensor used in the method. The electrochemical sensor comprises a three-electrode system anda detection pool, wherein the three-electrode system comprises a working electrode, an Ag/AgCl reference electrode and a platinum wire counter electrode; the working electrode is a modified glassy carbon electrode; and the detection pool is internally filled with a detection base solution of a buffer solution. Electrochemical detection is carried out on IAA (Indole-3-Acetic Acid) and SA (SalicylicAcid) by utilizing a graphene hydrogel modified electrode; the problems that a general chromatographic method and an immunological detection method are complicated to operate, expensive in cost, highin sample size, high in time consumption, and the like, are solved; the real-time detection on the IAA and the SA is realized; the electrochemical sensor has the advantages of being convenient and quick, being high in detection sensitivity, having the detection limit of the IAA being as low as 0.677 mug/ml and the detection limit of the SA being as low as 0.569 mug/ml, and being low in needed sample amount, extremely low in detection cost, little in interference, and the like, and can be used for realizing the fast, simple, convenient and accurate quantitative detection on the IAA and the SA.