|  |  |  | 
|---|
|  |  |  | </header> | 
|---|
|  |  |  | <div class="layui-form layadmin-user-login-body"> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" placeholder="账号" autocomplete="off"> | 
|---|
|  |  |  | <input id="username" class="layui-input" type="text" name="username" lay-verify="username" placeholder="账号" autocomplete="off"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <input id="password" class="layui-input" type="password" name="password" lay-verify="password" placeholder="密码" autocomplete="off"> | 
|---|
|  |  |  | 
|---|
|  |  |  | $ = layui.jquery; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.on('submit(login)', function (data) { | 
|---|
|  |  |  | var mobile = $("#mobile").val(); | 
|---|
|  |  |  | if (mobile === "") { | 
|---|
|  |  |  | var username = $("#username").val(); | 
|---|
|  |  |  | if (username === "") { | 
|---|
|  |  |  | layer.msg("请输入账号", {icon: 2}) | 
|---|
|  |  |  | $("#mobile").focus(); | 
|---|
|  |  |  | $("#username").focus(); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var password = $("#password").val(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var user = { | 
|---|
|  |  |  | mobile: mobile, | 
|---|
|  |  |  | username: username, | 
|---|
|  |  |  | password: hex_md5(password) | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | debugger | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/login.action", | 
|---|
|  |  |  | data: user, | 
|---|