Zhiqim Admin(简版的管理台)是从知启蒙管理台分离出来,保留系统参数表、系统菜单表、操作员、操作日志,去除组织、部门、角色等复杂权限功能,仅保留操作员独立权限功能。系统设计时保留ZmrSessionUser和ZmrOperator类,方便以后升级到知启蒙管理台。
森中灵 最后提交于5月前 整理V8.0.6
index.htm6KB
<!DOCTYPE html>
<html>
<head>
<title>${context.getContextName()}</title>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
${Styles.src(zhiqim.css)}
${Scripts.src(zhiqim.js)}
${Scripts.src(jsencrypt.js)}
${Styles.htmlOverflowHidden()}
${Scripts.src(new ZmrCdnRuntime(context, "/service/res/extend/zhiqim_webgl_three.js"))}
<style>
body{color:#333;background-color:#1d72c0;}
body,table,td,div{font-size:14px;line-height:120%;}
a,a:visited{color:#333;text-decoration:none;cursor:pointer;}
a:active,a:hover{color:#1e7eec;text-decoration:none;}
.header{position:fixed;width:100%;height:40px;line-height:40px;background:rgba(255,255,255,0.2);z-index:20;}
.footer{position:fixed;bottom:0px; width:100%;height:40px;background:rgba(255,255,255,0.2);line-height:40px;text-align:center;color:#fff;}
.login{width:520px;padding:20px;background:rgba(255,255,255,0.6);}
.input{color:#333;font-size:18px;border:2px solid #fffafa;border-radius:5px;height:50px;line-height:50px;text-indent:10px;font-family:Consolas,"微软雅黑";}
.input.verificationCode{letter-spacing:4px;}
</style>
<script>
Z.onload(function()
{//默认焦点
if (Z("#operatorCode").val() == "")
Z("#operatorCode").focus();
else if (Z("#operatorPass").val() == "")
Z("#operatorPass").focus();
else if (Z("#verificationCode").val() == null)
Z("#verificationCode").focus();
else
Z("#operatorCode").focus();
var three = new Z.WebGLThree();
three.threePath = "${new ZmrCdnRuntime(context, "/service/res/extend/three.js")}";
three.elem = "z-webgl-canvas";
three.execute();
Z(document).keydown(function(e)
{
if (Z.E.key(e) != Z.E.KEY.ENTER)
return;
if (!Z.Dialog.cache.isEmpty())
return;
doLogin();
});
});
function doRememberCode(rememberCode)
{//取消记住账号时,同时取消记住密码
if (!rememberCode.checked)
{
Z("#rememberPass")[0].checked = false;
Z("[data-id=rememberPass]").removeClass("z-active");
}
}
function doRememberPass(rememberPass)
{//记住密码时,同时记住账号
if (rememberPass.checked)
{
Z("#rememberCode")[0].checked = true;
Z("[data-id=rememberCode]").addClass("z-active");
}
}
function doLogin()
{//ajax登陆
var operatorCode = Z("#operatorCode").val();
if (Z.V.isEmptyBlank(operatorCode))
{//账号和密码必填
Z.failure("账号不能为空!");
Z("#operatorCode").focus();
return;
}
var operatorPass = Z("#operatorPass").val();
if (Z.V.isEmptyBlank(operatorPass))
{//账号和密码必填
Z.failure("密码不能为空!");
Z("#operatorPass").focus();
return;
}
var verificationCode = Z("#verificationCode").val();
if (Z("#verificationCode").length > 0 && verificationCode.length != 4)
{//如果有验证码框的时候,要求值必须是4位(数字在输入时控制)
Z.failure("验证码为4位数字!");
return;
}
//对密码进行RSA加密
var publicKey = "${ZmrParamDao.getPublicKey()}";
var encrypt = new JSEncrypt();
encrypt.setPublicKey(publicKey);
operatorPass = encrypt.encrypt(operatorPass);
var ajax = new Z.Ajax();
ajax.setContextPath("${context.getContextPath()}");
ajax.setClassName("ZmrLoginPresenter");
ajax.setMethodName("doLogin");
ajax.addParam("operatorCode", operatorCode);
ajax.addParam("operatorPass", operatorPass);
<#if hasRememberPass>
if (Z("#rememberPass")[0].checked)
ajax.addParam("rememberPass", rememberPass);
</#if>
<#if hasRememberCode>
if (Z("#rememberCode")[0].checked)
ajax.addParam("rememberCode", rememberCode);
</#if>
ajax.addParam("verificationCode", verificationCode);
ajax.setFailureAlert();
ajax.setSuccess(function(){window.location.href= this.responseText;});
ajax.execute();
}
</script>
</head>
<body>
<div class="header">
<div class="z-float-left z-w400 z-lh40 z-pd-l10 z-color-white">欢迎登录 [ ${context.getContextName()} ]</div>
<div class="z-float-right z-text-right z-w200 z-lh40 z-pd-r10"></div>
</div>
<div class="z-absolute-center-middle z-bd-rd10 login" style="height:<#if hasVerificationCode && hasRememberCode>420<#elseif hasVerificationCode>390<#elseif hasRememberCode>350<#else>320</#if>px">
<input type="text" class="z-hidden-fixed"/>
<input type="password" class="z-hidden-fixed"/>
<div class="z-px24 z-color-333 z-pd-b10 z-pd-l20"> <i class="z-font z-customer"></i> 用户登录</div>
<div style="padding:25px 40px 20px 30px;">
<table class="z-table z-h100p z-h70-tr z-pd5">
<tr>
<td><input id="operatorCode" class="z-w400 input" placeholder="账号" value="#{operatorCode}" maxlength="16" spellcheck="false" autocomplete="off"></td>
</tr>
<tr>
<td><input id="operatorPass" type="password" class="z-w100p input" placeholder="密码" value="#{operatorPass}" maxlength="16" spellcheck="false" autocomplete="off"></td>
</tr>
<#if hasVerificationCode>
<tr>
<td>
<input id="verificationCode" type="text" class="input verificationCode" style="width:270px" placeholder="验证码" maxlength="4" data-options="type:Numeric;paste:true;" spellcheck="false" autocomplete="off">
<img class="z-pointer z-bd-rd5 z-mg-t-5" title="点击刷新验证码" onclick="this.src='service/vcode.jpg?bgColor=%231299ec&width=120&height=50&fontSize=20&yawp=true&t='+new Date().getTime();" src="service/vcode.jpg?bgColor=%231299ec&width=120&height=50&fontSize=20&yawp=true&t=${DateTimes.getDateTime17String()}">
</td>
</tr>
</#if>
<#if hasRememberCode>
<tr class="zi-h40">
<td class="z-px16 z-color-333">
<input id="rememberCode" type="checkbox" data-role="z-checkbox" data-class="z-mg-r10 ${zmr_color_class}" onclick="doRememberCode(this);" <#if Validates.isNotEmpty(operatorCode)>checked</#if>>记住账号
<#if hasRememberPass>
<input id="rememberPass" type="checkbox" data-role="z-checkbox" data-class="z-mg-r10 ${zmr_color_class}" onclick="doRememberPass(this);" <#if Validates.isNotEmpty(operatorPass)>checked</#if>/>记住密码
</#if>
</td>
</tr>
</#if>
<tr>
<td><button class="z-button z-xlarge z-w100p z-h50 zi-px20 ${zmr_color_class}" onclick="doLogin()">登 录</button></td>
</tr>
</table>
</div>
</div>
<div class="footer">${zmr_copyright}</div>
<div id="z-webgl-canvas" class="z-absolute z-w100p z-h100p" style="z-index:-1;"></div>
</body>
</html>