| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>${(systemInfo.systemTitle)!} - 登陆</title>
- <link href="login/css/bootstrap.min.css" rel="stylesheet">
- <link href="login/css/font-awesome.css" rel="stylesheet">
- <link href="login/css/animate.css" rel="stylesheet">
- <link href="login/css/ladda-themeless.min.css" rel="stylesheet">
- <link href="login/css/style.css" rel="stylesheet">
- <style>
- @media (max-width: 768px) {
- #login_img_div {
- display: none;
- }
- }
- .colorred{
- color: red !important;
- }
- .submiting{
- background-color: #eeeeee !important;
- color: #9c9c9c !important;
- }
- .margintop15{
- margin-top: 15px;
- }
- .nomarginbottom{
- margin-bottom: 0px;
- }
- </style>
- </head>
- <body class="gray-bg">
- <div class="loginColumns animated fadeInDown" style="max-width: 1000px;">
- <div class="row">
- <div id="login_img_div" class="col-md-7 col-sm-7 col-lg-7">
- <img width="100%" src="login/images/login.jpg" height="350">
- </div>
- <div class="col-md-5 col-sm-5 col-lg-5">
- <div class="ibox-content" style="height: 350px;">
- <p> </p>
- <h1>登录</h1>
- <form class="m-t" id="loginform">
- <div class="form-group has-feedback">
- <label>用户名</label>
- <input type="text" name="username" class="form-control" placeholder="Username" autocomplete="off">
- <span class="glyphicon glyphicon-user form-control-feedback"></span>
- </div>
- <div class="form-group has-feedback nomarginbottom">
- <label>密码</label>
- <input type="password" name="password" class="form-control" placeholder="Password" autocomplete="off">
- <span class="glyphicon glyphicon-lock form-control-feedback"></span>
- </div>
- <#if (systemInfo.verCode)?? && systemInfo.verCode == "true">
- <#if (systemInfo.slide)?? && systemInfo.slide == "true">
- <div class="form-group nomarginbottom margintop15">
- <div id="embed-captcha"></div>
- <p id="wait" class="show">正在加载验证码......</p>
- <p id="notice" style="color: #ff0000" class="hide">请先拖动验证码到相应位置</p>
- </div>
- </#if>
- <#if (systemInfo.slide)?? && systemInfo.slide == "false">
- <div class="form-group nomarginbottom margintop15">
- <input type="text" name="verCode" onkeyup="verCodeText(this)" oninput="verCodeText(this)" maxlength="4" style="width: 60%;display: initial;" class="form-control" placeholder="验证码" autocomplete="off"/>
- <img id="verCodeId" src="" alt="" title="看不清换一张" onclick="getVerCode()" style="vertical-align:middle;" />
- <span id="isvercodeimg"></span>
- <input type="hidden" id="idvercode" autocomplete="off">
- </div>
- </#if>
- </#if>
- <label id="msg" style="color: #FFFFFF">.</label>
- <button type="button" id="submit" onclick="login()" class="ladda-button btn btn-primary block full-width m-b" data-style="zoom-in">登录</button>
- </form>
- </div>
- </div>
- </div>
- <hr/>
- <div class="row">
- <div class="col-md-7 col-sm-7 col-lg-7">${(systemInfo.systemTitle)!} </div>
- <div class="col-md-5 col-sm-5 col-lg-5 text-right">
- <small>${(systemInfo.systemFooter)!}</small>
- </div>
- </div>
- </div>
- <script src="login/js/jquery-2.1.1.js"></script>
- <script src="login/js/spin.min.js"></script>
- <script src="login/js/ladda.min.js"></script>
- <script src="login/js/ladda.jquery.min.js"></script>
- <script src="login/js/login.js"></script>
- <#if (systemInfo.slide)?? && systemInfo.slide == "true">
- <script src="login/js/gt.js"></script>
- </#if>
- <script>
- $(function () {
- <#if (systemInfo.verCode)?? && systemInfo.verCode == "true">
- <#if (systemInfo.slide)?? && systemInfo.slide == "true">
- // 滑动图片验证码
- verCodeImg();
- </#if>
- <#if (systemInfo.slide)?? && systemInfo.slide == "false">
- // 验证码图片
- getVerCode();
- </#if>
- </#if>
- });
- <#if (systemInfo.verCode)?? && systemInfo.verCode == "true">
- <#if (systemInfo.slide)?? && systemInfo.slide == "false">
- //验证码校验
- function verCodeText(dom){
- $("#isvercodeimg").html("");//验证码验证图片清除
- var verCode = $(dom).val()||"";
- //只能输入字母和数字
- $(dom).val(verCode.replace(/[^0-9a-zA-Z]/g,''));
- verCode = $(dom).val()||"";
- if(verCode.length > 4){
- verCode = verCode.substring(0,4);
- $(dom).val(verCode);
- }
- if(verCode.length == 4){
- isVerCode(verCode);
- }
- }
- //获得验证码
- function getVerCode(){
- $.ajax({
- type: "post",
- async: false, //同步执行
- url: "verCode",
- dataType: "json", //返回数据形式为json
- success: function(result) {
- //if (result.success) {
- $("#verCodeId").attr("src","data:image/png;base64,"+result.verCode);
- $("input[name='verCode']").val("");//验证码清空
- $("#isvercodeimg").html("");//验证码验证图片清除
- //}
- }
- });
- }
- //即时校验验证码
- function isVerCode(verCode){
- $.ajax({
- type: "post",
- async: false, //同步执行
- url: "isVerCode?verCode="+verCode,
- dataType: "json", //返回数据形式为json
- success: function(result) {
- if (result.success) {
- $("#idvercode").val("yes");
- $("#isvercodeimg").html("<img src='login/images/ok.png'/>");
- }else{
- $("#idvercode").val("");
- $("#isvercodeimg").html("<img src='login/images/cancel.png'/>");
- }
- }
- });
- }
- </#if>
- <#if (systemInfo.slide)?? && systemInfo.slide == "true">
- // 滑动图片验证码
- function verCodeImg(){
- var handlerEmbed = function (captchaObj) {
- $("#submit").click(function (e) {
- var validate = captchaObj.getValidate();
- if (!validate) {
- // $("#notice")[0].className = "show";
- showMsg($("#notice").html());
- setTimeout(function () {
- hideMsg();
- // $("#notice")[0].className = "hide";
- }, 2000);
- e.preventDefault();
- }
- });
- // 将验证码加到id为captcha的元素里
- captchaObj.appendTo("#embed-captcha");
- captchaObj.onReady(function () {
- $("#wait")[0].className = "hide";
- });
- // 更多接口参考:http://www.geetest.com/install/sections/idx-client-sdk.html
- };
- $.ajax({
- // 获取id,challenge,success(是否启用failback)
- url: "verCodeImg",
- type: "get",
- dataType: "json",
- success: function (data) {
- // 使用initGeetest接口
- // 参数1:配置参数
- // 参数2:回调,回调的第一个参数验证码对象,之后可以使用它做appendTo之类的事件
- initGeetest({
- gt: data.gt,
- challenge: data.challenge,
- width: "100%",
- product: "popup", // 产品形式,包括:float,embed,popup。注意只对PC版验证码有效
- offline: !data.success // 表示用户后台检测极验服务器是否宕机,一般不需要关注
- }, handlerEmbed);
- }
- });
- }
- </#if>
- </#if>
- document.onkeydown = function (e) { // 回车提交表单
- // 兼容FF和IE和Opera
- var theEvent = window.event || e;
- var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
- if (code == 13) {
- login();
- }
- }
- function showMsg(msg) {
- $("#msg").addClass("colorred").html(msg);
- }
- function hideMsg() {
- $("#msg").removeClass("colorred");
- }
- //登录信息校验
- function checkSearchForm() {
- var userName = $("input[name='username']").val() || "";
- if (userName == "") {
- showMsg("用户名不能为空!");
- return false;
- }
- var userPass = $("input[name='password']").val() || "";
- if (userPass == "") {
- showMsg("密码不能为空!");
- return false;
- }
- <#if (systemInfo.verCode)?? && systemInfo.verCode == "true">
- <#if (systemInfo.slide)?? && systemInfo.slide == "false">
- var verCode = $("input[name='verCode']").val()||"";
- if(verCode == ""){
- showMsg("验证码不能为空!");
- return false;
- }
- var isvercode = $("#idvercode").val()||"";
- if(isvercode != "yes"){
- showMsg("验证码错误!");
- return false;
- }
- </#if>
- </#if>
- return true;
- }
- </script>
- </body>
- </html>
|