Commit 8ac4e2a6 authored by 李苏's avatar 李苏 💬

登录页面

parent b46b768f
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>KMES-扫码登录入口</title>
<link rel="SHORTCUT ICON" href="images/logo.ico"/>
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/col.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<style type="text/css">
.kmessmdl{
width: 100vw;
height: 100vh;
position: relative;
}
.kmessmtitle{
position: absolute;
top: 10%;
right: 50%;
transform: translate(50%, -50%);
height: 4vh;
width: 40vw;
text-align: center;
line-height: 30px;
font-size: 30px;
background-color: #FFFFFF;
}
.kmessm{
position: absolute;
top: 50%;
right: 50%;
transform: translate(50%, -50%);
height: 25vh;
width:40vw;
background-color: #FFFFFF;
display: flex;
flex-wrap: wrap;
}
.kmessm div{
height: 50%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.kmessm label{
font-size: 2vh;
}
.logtext{
padding-left: 5px;
height: 5vh;
line-height: 3vh;
font-size: 3vh;
border: 0.5px solid #D3D3D3;
width: 80%;
}
.errdialog{
z-index: 99999;
min-width:35%;
/* width: 35%; */
height: 40px;
text-align: center;
line-height: 40px;
position: absolute;
top: 30px;
right: 50%;
color: #FFFFFF;
background-color: rgba(255,0,0,0.5);
transform: translateX(50%);
border-radius: 5px;
}
</style>
</head>
<body>
<div class="kmessmdl">
<div class="kmessmtitle">
<b>KMES扫码登录界面</b>
</div>
<div class="kmessm">
<div>
<label for="rygh">人员工号:</label><input class="logtext rygh" name="rygh"/>
</div>
<div>
<label for="gylx">工序类型:</label><input class="logtext gylx" name="gylx"/>
</div>
</div>
</div>
</body>
<script language="JavaScript" type="text/javascript" src="lib/easyui/jquery.min.js" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="lib/easyui/jquery.easyui.min.js" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="lib/easyui/locale/easyui-lang-zh_CN.js"></script>
<script language="JavaScript" type="text/javascript" src="js/common/http.js"></script>
<script language="JavaScript" type="text/javascript" src="js/common/md5.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/common/json2.js"></script>
<script language="JavaScript" type="text/javascript" src="js/common/jquery.cookie.js"></script>
<script type="text/javascript">
let $rygh=$(".rygh")
let $gylx=$(".gylx")
$rygh.focus()
$rygh.keydown(function(e){
if (e.keyCode == 13) {
$gylx.focus()
}
})
$gylx.keydown(function(e){
if (e.keyCode == 13) {
apiLogin()
}
})
/* 提示框 */
/* 大屏内部弹框 */
function logalert(msg){
let getdom=$("body")
getdom.css('position','relative')
let dialog="<div class='errdialog'>"+msg+"</div>"
getdom.prepend(dialog)
setTimeout(function(){
$('.errdialog').remove();
},2000)
}
/* 登录api */
function apiLogin(){
let usersn=$rygh.val()
let bzgxsn=$gylx.val()
HTTP.post("kmes/gpfk/login ", {usersn:usersn,bzgxsn:bzgxsn}, function(result) {
if (result['success']) {
localStorage.setItem("username",result.data.username||"未知用户");
// window.location.href = "index";
let mkurl=result.data.records.fkurl
let mkid=result.data.records.modulecode
let bzlx=result.data.records.id
let gx=result.data.records.name
let url="singleindex?url="+mkurl+"#"+mkurl+";"+mkid+"+"+bzlx+"!"+gx
window.location.href =url
} else {
logalert(result.message||"登录失败")
$rygh.val("")
$gylx.val("")
$rygh.focus()
}
});
}
</script>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment