<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>头脑风暴 - 登陆</title>
  <meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="full-screen" content="yes"/> <!--部分原生机子-->
<meta name="screen-orientation" content="portrait"/> <!--UC浏览器-->
<meta name="x5-fullscreen" content="true"/> <!--QQ浏览器-->
<meta name="360-fullscreen" content="true"/> <!--360浏览器-->

<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="csrf-token" content="{{ csrf_token() }}">
  {!!Html::style('plugins/layui/css/layui.css')!!}
    <script>
(function(f,j){var i=document,d=window;var b=i.documentElement;var c;var h=i.querySelector('meta[name="viewport"]');var e="width=device-width,initial-scale=1,maximum-scale=1.0,user-scalable=no";if(h){h.setAttribute("content",e)}else{h=i.createElement("meta");h.setAttribute("name","viewport");h.setAttribute("content",e);if(b.firstElementChild){b.firstElementChild.appendChild(h)}else{var a=i.createElement("div");a.appendChild(h);i.write(a.innerHTML)}}function g(){var k=b.getBoundingClientRect().width;if(!j){j=540}if(k>j){k=j}var l=k*100/f;b.style.fontSize=l+"px"}g();d.addEventListener("resize",function(){clearTimeout(c);c=setTimeout(g,300)},false);d.addEventListener("pageshow",function(k){if(k.persisted){clearTimeout(c);c=setTimeout(g,300)}},false);if(i.readyState==="complete"){i.body.style.fontSize="16px"}else{i.addEventListener("DOMContentLoaded",function(k){i.body.style.fontSize="16px"},false)}})(750,750);
</script>
</head>
<body>
<form class="layui-form" action="" >
  <div class="layui-form-item" >
    <!-- <label class="layui-form-label">输入名字</label> -->
    <div class="layui-input-block">
      <input type="text" name="username"   required  lay-verify="required" placeholder="输入名字" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo">登陆</button>
    </div>
  </div>
</form>
{!!Html::script('plugins/layui/layui.js')!!}
<script>
layui.use(['form','jquery'], function(){
  var form = layui.form;
  var $ = layui.$;
$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});
  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    var url = "/Home/User/Login";
    $.post(url,data.field,function(responsedata){
        layer.msg(responsedata.msg, {
          time: 1000 //2秒关闭（如果不配置，默认是3秒）
        }, function(){
			layer.msg("跳转中...", {
	          time: 1000 //2秒关闭（如果不配置，默认是3秒）
	        }); 
      		window.location.href = '/Home/User/Index';
        }); 
    },'json');
    return false;
  });
});
</script>
</body>
</html>