Home  >  Q&A  >  body text

There is something wrong with the teacher’s code

is the admin/User/userlist method. I think it should not be written in the User.php file because there is a login method in the User controller. It will not integrate the base class and it will not verify whether it is a user. Only after logging in can you have permission to control. Therefore, if you follow what the teacher wrote, when the user is not logged in, he can access the domain name /admin/User/userlist directly in the address. This is incorrect.

李2146 days ago1231

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2019-01-24 11:26:43

    You can integrate these judgment operations into the public controller. You can call the judgment in the specified method in the accessible controller, or you can write it directly into the pre-operation of the access controller. Appreciate your work. Independent thinking

    reply
    2
  • 李

    Thank you, Teacher Zhu, I have been listening to your courses.

    · 2019-01-24 11:56:13
  • Cancelreply