The management of chronic infected wounds poses significant challenges due to frequent bacterial infections, high concentrations of reactive oxygen species, abnormal immune regulation, and impaired angiogenesis. This study introduces a novel, microenvironment-responsive, dual dynamic, and covalently bonded hydrogel, termed OHA-P-TA/G/Mg2+. It is derived from the reaction of tannic acid (TA) with phenylboronic acids (PBA), which are grafted onto oxidized hyaluronic acid (OHA-P-TA), combined with GelMA (G) via a Schiff base and chemical bonds, along with the incorporation of Mg2+. This hydrogel exhibits pH and ROS dual-responsiveness, demonstrating effective antibacterial capacity, antioxidant ability, and the anti-inflammatory ability under distinct acidic and oxidative microenvironments. Furthermore, the release of Mg2+ from the TA-Mg2+ network (TA@Mg2+) promotes the transformation of pro-inflammatory M1 phenotype macrophages to anti-inflammatory M2 phenotype, showing a microenvironment-responsive response. Finally, in vivo results indicate that the OHA-P-TA/G/Mg2+ hydrogel enhances epithelial regeneration, collagen deposition, and neovascularization, showing great potential as an effective dressing for infected wound repair.