javascript - node.js express framework needs to enter admin through adminlogin, otherwise it will not be able to access admin. How to write
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-06-10 09:48:29
0
1
568
  1. node.js express needs to enter admin through adminlogin, otherwise it will not be able to access admin. How to write to jump directly to the adminlogin page?

  2. Then there is another problem, that is, when entering /admin in the address bar, you must first jump to the /adminlogin page

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all (1)
小葫芦

Check the cookie beforeadminrouting. If there is a valid cookie, continue the access. If not, jump toadminlogin.

To handle cookies, you can useexpress-sessionThis library supports Redis and MongoDB.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!