当前位置:主页 > 查看内容

实战 用户登录、Session校验、分布式存储Session

发布时间:2021-04-07 00:00| 位朋友查看

简介:实现登录功能 然后再创建login.css存放于在static下,css目录中,id 为 content 的 样式; #content{ margin- left :220px; margin- right :1420px; margin- top :100px; margin-bottom:auto; background-color:orange; } 创建login.html登录页面 !DOCTYPEhtm……

实现登录功能

然后再创建login.css存放于在static下,css目录中,id 为 content 的 样式;

  1. #content { 
  2.         margin-left: 220px; 
  3.         margin-right: 1420px; 
  4.         margin-top: 100px; 
  5.         margin-bottom: auto; 
  6.         background-color: orange; 
  7.     } 

创建login.html登录页面

  1. <!DOCTYPE html> 
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org"
  3. <head> 
  4.     <meta charset="UTF-8"
  5.     <title>登录</title> 
  6.     <!-- 如何引入本地css文件--> 
  7.     <link rel="stylesheet" th:href="@{/css/login.css}"/> 
  8. </head> 
  9. <body> 
  10. <div id="content"
  11.     <!-- 错误是提示--> 
  12.     <label id="errorMsg" style="color: crimson">[[${errorMsg}]]</label> 
  13.     <form id="login_form" action="/login" method="post"
  14.         姓名:<input type="text" id="uname" name="uname"><br/> 
  15.         密码:<input type="password" id="password" name="password"><br/> 
  16.         <button onclick="login()">登录</button> 
  17.     </form> 
  18. </div> 
  19. </body> 
  20. </html> 

本文转载自网络,原文链接:https://mp.weixin.qq.com/s/D8iSCw6fz3px12QOv3Uo6w
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文

  • 周排行
  • 月排行
  • 总排行

随机推荐