Recently, rapid acquisition of bacterial resistance and consequent slow healing of infected wounds threaten human life and health. In this study, chitosan-based hydrogels and nanocomplexes ZnPc(COOH)8:PMB composed of photosensitizer ZnPc(COOH)8 and antibiotic polymyxin B (PMB) were integrated into a thermosensitive antibacterial platform ZnPc(COOH)8:PMB@gel. Interestingly, fluorescence and reactive oxygen species (ROS) of ZnPc(COOH)8:PMB@gel can be triggered by E. coli bacteria at 37 °C, but not by S. aureus bacteria, which gave the potential to simultaneously detect and treat Gram-negative bacteria. The survival rate for a certain amount of E. coli bacteria treated with ZnPc(COOH)8:PMB (ZnPc(COOH)8 2 μM) was decreased by approximately fivefold than that with either ZnPc(COOH)8 or PMB alone, indicating combined antibacterial efficacy. ZnPc(COOH)8:PMB@gel facilitated the complete healing of wounds infected with E. coli bacteria in about seven days, while over 10 % wounds treated with ZnPc(COOH)8 or PMB remained unhealed on the 9th day. ZnPc(COOH)8:PMB resulted in a threefold increase of ZnPc(COOH)8 fluorescence in E. coli bacteria suggesting enhanced uptake of ZnPc(COOH)8 for the intervention of PMB on membrane permeability. The construction principle of the thermosensitive antibacterial platform and the combined antimicrobial strategy can be applied to other photosensitizers and antibiotics for detection and treatment of wound infections.