Higher-order topological states that possess gapped bulk energy bands and exotic topologically protected boundary states with at least two dimension lower than the bulk have significantly opened a new perspective for understanding of topological quantum matters. Here, we propose to generate two-dimensional topological boundary states for implementing synthetic magnetic flux of ultracold atoms trapped in bilayer optical lattices, which includes Chern insulator, Dirac semimetals, and second-order topological phase (SOTP) by the interplay of the two-photon detuning and effective Zeeman shift. These observed topological phases can be well characterized by the energy gap of bulk, Wilson loop spectra, and the spin textures at the higher symmetric points of system. We show that the SOTP exhibits a pair of $0$D boundary states. While the phases of Dirac semimetals and Chern insulator support the conventional $1$D boundary states due to the principle of bulk-boundary correspondence. Strikingly, the emerged boundary states for Dirac semimetals and SOTP are topologically protected by $\cal P T$-symmetry and chiral-mirror symmetry ($\mathcal{\widetilde{M}}_{\alpha}$), respectively. In particular, the location of $0$D corner states for SOTP which are associated with existing $\mathcal{\widetilde{M}}_{\alpha}$-symmetry can be highly manipulated by tuning magnetic flux. Our scheme herein provides a platform for emerging exotic topological boundary states, which may facilitate the study of higher-order topological phases in ultracold atomic gases.