添加登录验证码

This commit is contained in:
yanwnewu 2018-12-27 14:00:45 +08:00
parent 34f32a686d
commit e19e8b756b
2 changed files with 9 additions and 3 deletions

View File

@ -48,7 +48,7 @@ class Login extends Controller
return [ return [
$this->name() => 'require', $this->name() => 'require',
'password|密码' => 'require', 'password|密码' => 'require',
//'captcha|验证码' => 'require|captcha' 'captcha|验证码' => 'require|captcha'
]; ];
} }

View File

@ -26,10 +26,16 @@
<div class="form-group"> <div class="form-group">
<input type="password" name="password" class="form-control" placeholder="密码" required=""> <input type="password" name="password" class="form-control" placeholder="密码" required="">
</div> </div>
<div class="form-group">
<input type="text" name="captcha" class="form-control" placeholder="验证码" required style="width: 65%;display: inline-block;float: left;">
<div style="display: inline-block;float: left;height: 41px;">
<img src="{:captcha_src()}" alt="captcha" style="height: 80%;" onclick="this.src=this.src + Math.random()"/>
</div>
</div>
<button type="submit" class="btn btn-primary block full-width m-b">登 录</button> <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>
<p class="text-muted text-center"> <!--<p class="text-muted text-center">
<a href="login.html#"><small>忘记密码了?</small></a> | <a href="register.html">注册一个新账号</a> <a href="login.html#"><small>忘记密码了?</small></a> | <a href="register.html">注册一个新账号</a>
</p> </p>-->
</form> </form>
</div> </div>
</div> </div>