We propose and numerically verify a phase-based all-optical logic gates (AND, OR, XOR, NOT, NAND, NOR and XNOR, i.e. all seven basic logic gates) operation scheme based on cascaded AlGaAs microring resonators. The logic function realization is supported by the signal light phase change and extraction, the phase control in this scheme depending on cross phase modulation (XPM) in the AlGaAs microring. By inputting a non-return zero (NRZ) intensity signal as pump light, the probe light (continuous-wave, CW) will experience different phase shift and then a phase-based logical function can be obtained in this process. By choosing different pump power level, reference phase and the output port of a Mach-Zehnder interferometer (MZI), all seven basic logic operations can be realized by using the same device. The modulation depth, bandwidth and minimum power requirement of this scheme have also been discussed in detail.