TP5.1 登录验证及拦截
登录只做记录不做解释,重点是拦截。
1 HTML
1.1 关键代码
页面用了layui的表单样式(class),
内置的表单验证( required lay-verify="required"),
以及表单提交操作( lay-filter="submit_login" lay-submit)。
login.html
<div style="height: 400px;margin-top: 100px">
<div class="layui-form layui-form-pane" style="text-align: center;">
<form>
<div class="layui-form-item">
<div class="layui-inline">
<label for="username" class="layui-form-label">用户名</label>
<div class="layui-input-inline">
<input type="text"
name="username"
required lay-verify="required"
autocomplete="off"
class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label for="userpwd" class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password"
name="userpwd"
required lay-verify="required" a
utocomplete="off"
class="layui-input">
</div>
</div>
</div>
<div class="layui-form-