search

Home  >  Q&A  >  body text

javascript - node.js express framework needs to enter admin through adminlogin, otherwise it will not be able to access admin. How to write

  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

曾经蜡笔没有小新曾经蜡笔没有小新2805 days ago657

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-06-10 09:50:29

    Check the cookie before admin routing. If there is a valid cookie, continue the access. If not, jump to adminlogin.

    To handle cookies, you can use express-session This library supports Redis and MongoDB.

    reply
    0
  • Cancelreply