This disclosure is related to a fused-ring compound of formula (I) and/or a pharmaceutically acceptable salt thereof, a pharmaceutical composition comprising the fused ring compound of formula (I) and/or a pharmaceutically acceptable salt thereof, preparation methods thereof, and use thereof in modulating activity of indoleamine 2, 3-dioxygenase (IDO) and/or tryptophan 2, 3-dioxygenase (TDO). This disclosure further provides methods of treating IDO and/or TDO-associated diseases, including cancer, viral infection and autoimmune diseases.