Among the various aflatoxin B1 (AFB1) assays, performing accurate detection is difficult because false positives and false negatives are frequent due to limited sensitivity, expensive equipment, or inadequate pretreatment during operation. Here, an "off-on" switch-type electrochemiluminescence (ECL) aptasensor armed with cobalt-sulfur quantum dots was encapsulated in hollow cobalt-layered double hydroxide nanocages as an enhanced luminescent probe (Co-LDH@QDs), and a ferrocene-modified aptamer (Fc-APT) was used as a luminescent quencher. In general, when Fc-APT was hybridized with complementary DNA modified with a DNA nanotetrahedron, electron transfer between ferrocene and Co-LDH@QDs was facilitated, leading to efficient quenching of the ECL intensity into an "off" state in the absence of AFB1. In the presence of AFB1, the intensity of ECL increased with an increasing AFB1 concentration after Fc-APT specifically recognized that AFB1 was detached from the electrode interface to achieve an "on" state. The linear range of the proposed ECL aptasensor for AFB1 detection was 0.1 pg mL-1 to 10 ng mL-1, with a detection limit of 0.03 pg mL-1. We successfully employed the proposed ECL aptasensor for corn application, which provides an economical and simple alternative to complex and costly enzyme-linked immunoassays. The switch-type ECL aptasensor provides quick, accurate, and prospective technological support for pinpoint management of food safety.