This article addresses the issue of achieving security consensus in multi-agent systems (MASs) that are susceptible to denial-of-service attacks (DoS-As) and time-varying communication delays (TCD). We have developed a novel unified model to describe DoS-As and TCD. Firstly, a new switching adaptive dynamic event-triggered mechanism (SADETM) is proposed to conserve communication resources during DoS-As and TCD. The mechanism transforms into three event-triggered strategies adapted to highly dynamic MASs. Then, a consensus control protocol is designed through consensus errors based on SADETM. Finally, the sufficient conditions for ensuring the stability of MASs are solved by combining the Lyapunov-Krasovskii functional (LKF) method and the linear matrix inequality (LMI) technique. The effectiveness of this method is verified through simulation examples.