Is the execution order of tp5 ajax access page different from that of URL access?

as shown in the figure, my Role controller inherits the Common controller

I perform permission verification in the initialization constructor in the Common controller. When asked to access Role/index directly in the browser, the verification is successful, but when I access Role/index with ajax, I do not perform validation, I directly execute the index method!

Why is this?

Mar.17,2021

Sorry, this is a rubbish problem! When I look back, it looks like I even hide my face.

return exits the execution of the function and returns to the call place of the function!

exit should be used

Menu