| <!DOCTYPE html> | 
| <html> | 
| <head> | 
|     <meta charset="UTF-8" /> | 
|     <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" /> | 
|     <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> --> | 
|     <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | 
|     <title>Boxline PDA</title> | 
|      | 
|     <link rel="stylesheet" href="../layui/css/layui.css" /> | 
|     <link rel="stylesheet" href="../css/style.css" /> | 
|     <script src="../js/adaptive.js"></script> | 
|     <link rel="stylesheet" href="../css/my.css" /> | 
|     <style type="text/css"> | 
|         .main { | 
|             width: 86%; | 
|             /* background-color: #FFF9EC; */ | 
|             margin: auto; | 
|         } | 
|         .logo { | 
|             /* background-color: #00F7DE; */ | 
|             margin-top: 30px; | 
|             text-align: center; | 
|         } | 
|         .logo img { | 
|             width: 68%; | 
|             /* height: 107px; */ | 
|         } | 
|         .layui-input-block { | 
|             margin-left: 8%; | 
|             width: 92%; | 
|         } | 
|         .layui-input-block .layui-input { | 
|             border: none; | 
|             padding-left: 8px; | 
|             font-size: 16px; | 
|             /* line-height: 16px; */ | 
|             height: 35px; | 
|         } | 
|         .my-form-item { | 
|             margin-top: 10px; | 
|             /* background-color: #009E94; */ | 
|             height: 35px; | 
|         } | 
|         .little-icon { | 
|             width: 8%; | 
|             float: left; | 
|             text-align: center; | 
|             line-height: 32px; | 
|             /* background-color: #93D1FF; */ | 
|         } | 
|         .btn-login { | 
|             width: 100%; | 
|             /* background-color: #00FF00; */ | 
|             text-align: center; | 
|             height: 46px; | 
|             margin-top: 30px; | 
|         } | 
|         .btn-login input { | 
|             border: none;  | 
|             color: #FFFFFF; | 
|             background-color: #0a93e3; | 
|             background-size: 100% 100%; | 
|             width: 96%; | 
|             height: 100%; | 
|             font-size: 20px; | 
|             border-radius: 5px; | 
|         } | 
|         .btn-login input:active { | 
|             opacity: 0.8; | 
|         } | 
|         .dropdown-lang { | 
|             width: 92%; | 
|             margin-left: 8%; | 
|             position: relative; | 
|         } | 
|         .dropdown-lang .layui-edge { | 
|             display: none; | 
|         } | 
|         .dropdown-lang input { | 
|             border: 0; | 
|             font-size: 16px; | 
|         } | 
|         .dropdown-lang img { | 
|             position: absolute; | 
|             right: 18px; | 
|             top: 18px; | 
|             z-index: 5; | 
|         } | 
|         .dropdown-lang dl { | 
|             line-height: 50px; | 
|             padding: 0; | 
|             margin-top: 13px; | 
|             left: 0; | 
|             width: 100%; | 
|         } | 
|         .dropdown-lang dl dd { | 
|             line-height: 50px; | 
|             padding: 0; | 
|             padding-left: 8px; | 
|             font-size: 16px; | 
|         } | 
|     </style> | 
|     <link rel="stylesheet" href="../css/adapter.css" /> | 
| </head> | 
| <body> | 
|     <div class="main-content"> | 
|         <div id="" class="logo"> | 
|             <img src="../assets/logo.png" > | 
|         </div> | 
|         <form class="layui-form login_form"> | 
|             <div class="layui-form-item my-form-item"> | 
|                 <div id="" class="little-icon"> | 
|                     <img src="../assets/user.png" > | 
|                 </div> | 
|                 <div class="layui-input-block"> | 
|                     <input type="text" lang lay-verify="required" langholder value="" id="username" lay-reqText="Please input username" placeholder="请输入用户名" class="layui-input" > | 
|                 </div> | 
|                 <hr style="margin-top: 0;background-color: #cfcfcf;"> | 
|             </div> | 
|             <div class="layui-form-item my-form-item" > | 
|                 <div id="" class="little-icon"> | 
|                     <img src="../assets/pwd.png" > | 
|                 </div> | 
|                 <div class="layui-input-block"> | 
|                     <input type="password" lang langholder lay-verify="required" value="" id="userpwd" lay-reqText="Please input password" placeholder="请输入密码" class="layui-input"> | 
|                 </div> | 
|                 <hr style="margin-top: 0;background-color: #cfcfcf;"> | 
|             </div> | 
|             <div class="layui-form-item my-form-item" style="display: none;"> | 
|                 <div id="" class="little-icon"> | 
|                     <img src="../assets/language.png" > | 
|                 </div> | 
|                 <div id="" class="dropdown-lang"> | 
|                     <select id="languages" lay-filter="chooseLang"> | 
|                         <option value="zh">简体中文</option> | 
|                         <!-- <option value="en">English</option> --> | 
|                     </select> | 
|                     <img src="../assets/down_arraw.png" > | 
|                 </div> | 
|                 <hr style="margin-top: 0;background-color: #cfcfcf;"> | 
|             </div> | 
|             <div class="btn-login"> | 
|                 <a><input type="button" lay-submit lay-filter="formDemo" lang value="登录"></a> | 
|             </div> | 
|         </form> | 
|     </div> | 
|     <script src="../js/jquery-3.5.1.min.js"></script> | 
|     <script src="../layui/layui.js"></script> | 
|     <script src="../js/public.js"></script> | 
|     <script src="../js/language.js"></script> | 
|     <script src="../js/jquery.cookie.js"></script> | 
|     <script src="../js/jquery.md5.js"></script> | 
|     <script> | 
|         layui.use(['form'], function () { | 
|             clearLangData() | 
|             initLanguage() | 
|             var form = layui.form; | 
|              | 
|             if($.cookie("lang")==""){ | 
|                 $.cookie("lang", "zh") | 
|             } | 
|              | 
|             // $("select[name=languages]").value = "en" | 
|             // $("#languages").find("option[value='en']").attr("selected", true) | 
|             // $("#languages").val("Engish") | 
|             //console.log("999999999999") | 
|             $("#languages").val($.cookie("lang")) | 
|             form.render('select') | 
|              | 
|             setLanguage() | 
|              | 
|             form.on('select(chooseLang)', function(data) { | 
|                 //console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~select 被点击") | 
|                 $.cookie("lang", data.value) | 
|                  | 
|                 setLanguage() | 
|                 // alert(data.value) | 
|                 // $("#barMask").show() | 
|             }); | 
|              | 
|             $.cookie('userId', ''); | 
|             form.on('submit(formDemo)', function(data){ | 
|                 //console.log('登录'); | 
|                 var param = { | 
|                     "LoginName": $("#username").val(), | 
|                     "LoginPwd":$.md5($("#userpwd").val())  | 
|                 } | 
|                 //console.log('密码:'+$.md5($("#userpwd").val())) | 
|                 sendData(IP + "/WeatherForecast/Login", param, 'post', function (res) { | 
|                      | 
|                     if (res.status == "error") { | 
|                         layer.msg(res.statusText, { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                     } else { | 
|                         if(res.code==0){//成功 | 
|                             layer.msg('登陆成功', { | 
|                                 icon: 1, | 
|                                 time: 500 //2秒关闭(如果不配置,默认是3秒) | 
|                             }, function () { | 
|                                 $.cookie('token', res.data,{ path: '/' }); | 
|                                 //回调 | 
|                                 location.href="/View/index.html"; | 
|                             }); | 
|                         }else{//不成功 | 
|                             layer.msg(res.msg, { | 
|                                 icon: 2, | 
|                                 time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                             }, function () { | 
|                                 //回调 | 
|                             }); | 
|                         } | 
|                          | 
|                     } | 
|                      | 
|                 }); | 
|                 return false; | 
|             }); | 
|              | 
|         }) | 
|     </script> | 
| </body> | 
| </html> |