The present invention relates to a novel indoleamine-2, 3-dioxygenase (IDO) inhibitor, a preparation method therefor, and the uses thereof. The inhibitor is a compound as represented by formula (I) or a salt, a solvate, a polymorph, an enantiomer, or a racemic mixture pharmaceutically acceptable thereto. R1 or R2 is independently selected from hydrogen, a C1-C5 alkyl group, a halogen, and a substituent group as represented by formula (II), and one of the R1 and the R2 is the substituent group as represented by formula (II). R3 is selected from an aryl group, and n=0, 1, 2, or 3. Compared with a known IDO inhibitor, the novel inhibitor has a more powerful IDO inhibitory effect, and can be used to treat diseases having a pathological feature of an IDO-mediated tryptophan metabolic pathway, for example, tumors, cancers, Alzheimer disease, autoimmune diseases, cataract, mental disorders, depression, and / or anxiety disorders. The preparation method therefor has the advantages of easy operation and a mild reaction condition, and saves the solvent and reduces pollution, thereby facilitating industrial production.