Commit f7d76188622e77161dc74659cdc3853461ffbf18
1 parent
ea286ff4
1.去掉登录页面
Showing
1 changed file
with
390 additions
and
390 deletions
src/main/resources/static/login.html renamed to src/main/resources/static/e10adc3949ba59abbe56e057f20f883e.html
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html lang="zh"> | ||
| 3 | -<head> | ||
| 4 | - <meta name="renderer" content="webkit" /> | ||
| 5 | - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | - <meta charset="utf-8" /> | ||
| 7 | - <title>登录</title> | ||
| 8 | - <link | ||
| 9 | - href="/login_assets/css/font-awesome.min.css" | ||
| 10 | - rel="stylesheet" type="text/css" /> | ||
| 11 | - <!-- Bootstrap style --> | ||
| 12 | - <link href="/login_assets/css/bootstrap.min.css" | ||
| 13 | - rel="stylesheet" type="text/css" /> | ||
| 14 | - | ||
| 15 | - <!-- METRONIC style --> | ||
| 16 | - <link href="/login_assets/css/components.css" rel="stylesheet" | ||
| 17 | - type="text/css" /> | ||
| 18 | - | ||
| 19 | - <style type="text/css"> | ||
| 20 | - body>.wrapper { | ||
| 21 | - background-image: url(/login_assets/img/bg_9b9dcb65ff.png); | ||
| 22 | - background-size: 100px; | ||
| 23 | - background-repeat: repeat; | ||
| 24 | - min-height: 800px; | ||
| 25 | - min-width: 630px; | ||
| 26 | - position: absolute; | ||
| 27 | - top: 0; | ||
| 28 | - bottom: 0; | ||
| 29 | - left: 0; | ||
| 30 | - right: 0; | ||
| 31 | - } | ||
| 32 | - | ||
| 33 | - #loginPanel.dialog-shadow { | ||
| 34 | - width: 450px; | ||
| 35 | - /* height: 400px; */ | ||
| 36 | - border: 1px solid #dadada; | ||
| 37 | - border-radius: 10px !important; | ||
| 38 | - position: absolute; | ||
| 39 | - box-shadow: 0 9px 30px -6px rgba(0, 0, 0, .2), 0 18px 20px -10px | ||
| 40 | - rgba(0, 0, 0, .04), 0 18px 20px -10px rgba(0, 0, 0, .04), 0 10px 20px | ||
| 41 | - -10px rgba(0, 0, 0, .04); | ||
| 42 | - background: url(/login_assets/img/dialog-gray-bg_42c40b3eb6.png) #fff bottom | ||
| 43 | - repeat-x; | ||
| 44 | - top: 50%; | ||
| 45 | - left: 50%; | ||
| 46 | - margin-left: -225px; | ||
| 47 | - margin-top: -300px; | ||
| 48 | - text-align: center; | ||
| 49 | - color: #333; | ||
| 50 | - opacity: .5; | ||
| 51 | - | ||
| 52 | - padding-bottom: 56px; | ||
| 53 | - | ||
| 54 | - animation: to_center 1s forwards; | ||
| 55 | - animation-delay: .2s; | ||
| 56 | - | ||
| 57 | - transition: all .3s ease; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - @keyframes to_center | ||
| 61 | - { | ||
| 62 | - 0% {margin-top: -300px;opacity: .5;} | ||
| 63 | - 100% {margin-top: -270px;opacity: 1;} | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - | ||
| 67 | - h3 { | ||
| 68 | - font-size: 25px; | ||
| 69 | - font-weight: 600; | ||
| 70 | - color: #4a4a4a | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - .input-icon input { | ||
| 74 | - height: 48px; | ||
| 75 | - border-radius: 5px !important; | ||
| 76 | - transition: all .5s ease; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - .input-icon input:FOCUS { | ||
| 80 | - border-color: #c2cad8; | ||
| 81 | - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12) !important; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - .input-icon>i { | ||
| 85 | - margin-top: 16px; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - #loginPanel #loginBtn.btn{ | ||
| 89 | - border-radius: 6px !important; | ||
| 90 | - width: 378px; | ||
| 91 | - height: 48px; | ||
| 92 | - font-size: 20px; | ||
| 93 | - font-family: 微软雅黑; | ||
| 94 | - transition: all .3s ease; | ||
| 95 | - | ||
| 96 | - background: #5f7ed7; | ||
| 97 | - background: linear-gradient(#6f97e5,#527ed9); | ||
| 98 | - box-shadow: inset 0 1px 2px #7ea1e8 !important; | ||
| 99 | - color: #fff; | ||
| 100 | - text-shadow: #4f70b3 0 -1px 0; | ||
| 101 | - border: none; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - #loginPanel #loginBtn.btn:HOVER { | ||
| 105 | - box-shadow: inset 0 1px 1px #7696de,inset 0 0 2px #627dca,inset 0 -2px 3px #5a77c7,inset 0 0 100px rgba(48,77,147,.4) !important; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - | ||
| 109 | - #loginPanel.show_msg{ | ||
| 110 | - top: calc(50% - 10px); | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - #loginPanel .alert{ | ||
| 114 | - display: none; | ||
| 115 | - padding: 12px; | ||
| 116 | - margin-top: 21px; | ||
| 117 | - border-radius: 0 0 10px 10px !important; | ||
| 118 | - font-size: 13px; | ||
| 119 | - | ||
| 120 | - position: absolute; | ||
| 121 | - width: 100%; | ||
| 122 | - border-bottom: 1px solid #dadada; | ||
| 123 | - } | ||
| 124 | - | ||
| 125 | - #loginPanel .alert.login-success{ | ||
| 126 | - color: #27a4b0; | ||
| 127 | - background: #abe7ed; | ||
| 128 | - border-color: #abe7ed; | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - #loginPanel .alert i{ | ||
| 132 | - font-size: 16px; | ||
| 133 | - vertical-align: middle; | ||
| 134 | - margin: 0 5px 3px; | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - #loginPanel.show_msg .alert{ | ||
| 138 | - display: block; | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - #captchaWrap{ | ||
| 142 | - display: none; | ||
| 143 | - text-align: left; | ||
| 144 | - border-top: 1px solid #f3f2f2; | ||
| 145 | - } | ||
| 146 | - | ||
| 147 | - img.captcha-img{ | ||
| 148 | - cursor: pointer; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - .login-footer{ | ||
| 152 | - position: fixed; | ||
| 153 | - width: 100%; | ||
| 154 | - bottom: 35px; | ||
| 155 | - text-align: center; | ||
| 156 | - color: #a6a6a6; | ||
| 157 | - } | ||
| 158 | - | ||
| 159 | - h3.logo-text{ | ||
| 160 | - font-family: 华文楷体,华文细黑; | ||
| 161 | - font-size: 28px; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - .warn-note{ | ||
| 165 | - width: 100%; | ||
| 166 | - position: absolute; | ||
| 167 | - top: 0; | ||
| 168 | - z-index: 2; | ||
| 169 | - text-align: center; | ||
| 170 | - background: #ff4646; | ||
| 171 | - color: white; | ||
| 172 | - padding: 12px; | ||
| 173 | - display: none; | ||
| 174 | - } | ||
| 175 | - </style> | ||
| 176 | -</head> | ||
| 177 | - | ||
| 178 | -<body> | ||
| 179 | -<div class="warn-note">警告!系统目前仅在 WebKit 内核下完成兼容性测试,请使用 Google | ||
| 180 | - Chrome 浏览器进入系统。</div> | ||
| 181 | -<div class="wrapper ng-scope"> | ||
| 182 | - <div id="loginPanel" class="dialog dialog-shadow"> | ||
| 183 | - <br> | ||
| 184 | - <h3 class="logo-text">浦东公交调度系统</h3> | ||
| 185 | - <hr> | ||
| 186 | - <form style="padding: 0px 35px;"> | ||
| 187 | - <div class="form-group" style="margin-bottom: 0"> | ||
| 188 | - <label></label> | ||
| 189 | - <div class="input-icon"> | ||
| 190 | - <i class="fa fa-user font-gray"></i> <input type="text" | ||
| 191 | - name="userName" class="form-control" placeholder="输入用户名" | ||
| 192 | - autofocus="autofocus" autocomplete="off"> | ||
| 193 | - </div> | ||
| 194 | - </div> | ||
| 195 | - | ||
| 196 | - <div class="form-group"> | ||
| 197 | - <label></label> | ||
| 198 | - <div class="input-icon"> | ||
| 199 | - <i class="fa fa-key font-gray"></i> <input type="password" | ||
| 200 | - name="password" class="form-control" placeholder="输入密码" autocomplete="off"> | ||
| 201 | - </div> | ||
| 202 | - </div> | ||
| 203 | - | ||
| 204 | - <div class="form-group" id="captchaWrap"> | ||
| 205 | - <label></label> | ||
| 206 | - <div class="input-icon"> | ||
| 207 | - <input type="text" name="captcha" style="width: 153px !important;" | ||
| 208 | - class="form-control input-inline input-medium" | ||
| 209 | - placeholder="输入验证码" autocomplete="off"> <span class="help-inline"> <img | ||
| 210 | - alt="验证码" class="captcha-img" title="点击刷新验证码"> | ||
| 211 | - </span> | ||
| 212 | - </div> | ||
| 213 | - </div> | ||
| 214 | - </form> | ||
| 215 | - <br> | ||
| 216 | - <br> | ||
| 217 | - <div class="form-actions"> | ||
| 218 | - <button class="btn blue-steel" id="loginBtn" disabled="disabled">登录</button> | ||
| 219 | - </div> | ||
| 220 | - | ||
| 221 | - <div class="alert alert-danger"></div> | ||
| 222 | - </div> | ||
| 223 | - | ||
| 224 | - <div class="login-footer">© 2016 上海巴士拓华科技发展有限公司 Some Rights | ||
| 225 | - Reserved</div> | ||
| 226 | -</div> | ||
| 227 | - | ||
| 228 | -<script> | ||
| 229 | - delete window.require; | ||
| 230 | - delete window.exports; | ||
| 231 | - delete window.module; | ||
| 232 | -</script> | ||
| 233 | -<!-- jQuery --> | ||
| 234 | -<script src="/login_assets/js/jquery.min.js"></script> | ||
| 235 | -<script src="/login_assets/js/jsencrypt.min.js"></script> | ||
| 236 | -<script> | ||
| 237 | - window.onload=function(){ | ||
| 238 | - var body=document.getElementsByTagName("body")[0]; | ||
| 239 | - if(typeof body.style.WebkitAnimation=="undefined") | ||
| 240 | - $('.warn-note').fadeIn(); | ||
| 241 | - }; | ||
| 242 | - !function(){ | ||
| 243 | - var form = $('#loginPanel form') | ||
| 244 | - ,nameInput = $('input[name=userName]', form) | ||
| 245 | - ,pwdInput = $('input[name=password]', form) | ||
| 246 | - ,msgAlert = $('#loginPanel .alert-danger'); | ||
| 247 | - | ||
| 248 | - $('input', form).on('keyup', checkBtnStatus); | ||
| 249 | - | ||
| 250 | - var keys; | ||
| 251 | - $.get('/user/login/jCryptionKey?t='+Math.random(), function(data){ | ||
| 252 | - keys = data.publickey; | ||
| 253 | - }); | ||
| 254 | - | ||
| 255 | - | ||
| 256 | - | ||
| 257 | - function checkBtnStatus(){ | ||
| 258 | - var es = $('input:visible', form); | ||
| 259 | - for(var i = 0, e; e = es[i++];){ | ||
| 260 | - if($.trim($(e).val()) == ''){ | ||
| 261 | - $('#loginBtn').attr('disabled', 'disabled'); | ||
| 262 | - $('#loginPanel').removeClass('show_msg'); | ||
| 263 | - return; | ||
| 264 | - } | ||
| 265 | - } | ||
| 266 | - $('#loginBtn').removeAttr('disabled'); | ||
| 267 | - } | ||
| 268 | - | ||
| 269 | - nameInput.on('blur', checkStatus); | ||
| 270 | - //keyup 事件做延迟 | ||
| 271 | - var uNameKeyup; | ||
| 272 | - nameInput.on('keyup', function(){ | ||
| 273 | - if(uNameKeyup) | ||
| 274 | - return; | ||
| 275 | - uNameKeyup = true; | ||
| 276 | - setTimeout(function(){ | ||
| 277 | - checkStatus(); | ||
| 278 | - uNameKeyup = false; | ||
| 279 | - }, 200); | ||
| 280 | - }); | ||
| 281 | - | ||
| 282 | - //密码框回车事件 | ||
| 283 | - pwdInput.on('keyup', function(e){ | ||
| 284 | - if (e.keyCode == 13) | ||
| 285 | - $('#loginBtn').click(); | ||
| 286 | - }); | ||
| 287 | - //验证码框回车事件 | ||
| 288 | - $('input[name=captcha]').on('keyup', function(e){ | ||
| 289 | - if (e.keyCode == 13) | ||
| 290 | - $('#loginBtn').click(); | ||
| 291 | - }); | ||
| 292 | - | ||
| 293 | - $('#loginBtn').on('click', function(){ | ||
| 294 | - if(lock || $(this).attr('disabled')) return; | ||
| 295 | - var userName = nameInput.val() | ||
| 296 | - ,pwd = pwdInput.val(); | ||
| 297 | - | ||
| 298 | - //RSA加密 | ||
| 299 | - var encrypt = new JSEncrypt(); | ||
| 300 | - encrypt.setPublicKey(keys); | ||
| 301 | - userName = encrypt.encrypt(userName); | ||
| 302 | - pwd = encrypt.encrypt(pwd); | ||
| 303 | - //登录 | ||
| 304 | - login(userName, pwd); | ||
| 305 | - }); | ||
| 306 | - | ||
| 307 | - var lock; | ||
| 308 | - function login(userName, pwd){ | ||
| 309 | - lock = true; | ||
| 310 | - $('#loginBtn').attr('disabled', 'disabled'); | ||
| 311 | - | ||
| 312 | - var params = { | ||
| 313 | - userName: userName, | ||
| 314 | - password: pwd, | ||
| 315 | - captcha: $('input[name=captcha]').val() | ||
| 316 | - }; | ||
| 317 | - $.post('/user/login', params | ||
| 318 | - ,function(rs){ | ||
| 319 | - | ||
| 320 | - $('#loginPanel').addClass('show_msg'); | ||
| 321 | - if(error(rs)){ | ||
| 322 | - lock = false; | ||
| 323 | - $('#loginBtn').removeAttr('disabled'); | ||
| 324 | - msgAlert.html('<i class="fa fa-times-circle"> </i> 登录失败,' + rs.msg); | ||
| 325 | - | ||
| 326 | - _captcha.refresh(); | ||
| 327 | - checkStatus(); | ||
| 328 | - } | ||
| 329 | - else{ | ||
| 330 | - msgAlert.html('<i class="fa fa-check"> </i> 登录成功!'); | ||
| 331 | - msgAlert.addClass('login-success'); | ||
| 332 | - window.location.href = '/'; | ||
| 333 | - } | ||
| 334 | - }); | ||
| 335 | - } | ||
| 336 | - | ||
| 337 | - function checkStatus(){ | ||
| 338 | - var t = nameInput.val(); | ||
| 339 | - if(!t){ | ||
| 340 | - hide(); | ||
| 341 | - return; | ||
| 342 | - } | ||
| 343 | - | ||
| 344 | - $.get('/user/login/captchaStatus', {userName: t}, function(rs){ | ||
| 345 | - if(rs > 1) | ||
| 346 | - _captcha.show(); | ||
| 347 | - else | ||
| 348 | - hide(); | ||
| 349 | - }); | ||
| 350 | - | ||
| 351 | - function hide(){ | ||
| 352 | - if(!$("#captchaWrap").is(":hidden")){ | ||
| 353 | - _captcha.hide(); | ||
| 354 | - //隐藏提示消息 | ||
| 355 | - //msgAlert.html(''); | ||
| 356 | - //$('#loginPanel').removeClass('show_msg'); | ||
| 357 | - } | ||
| 358 | - } | ||
| 359 | - } | ||
| 360 | - | ||
| 361 | - | ||
| 362 | - var _captcha = { | ||
| 363 | - show: function(){ | ||
| 364 | - if($("#captchaWrap").is(":hidden")){ | ||
| 365 | - $('#captchaWrap').fadeIn(500); | ||
| 366 | - _captcha.refresh(); | ||
| 367 | - checkBtnStatus(); | ||
| 368 | - } | ||
| 369 | - }, | ||
| 370 | - refresh: function(){ | ||
| 371 | - if($("#captchaWrap").is(":hidden")) | ||
| 372 | - return; | ||
| 373 | - $('#captchaWrap img.captcha-img').attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 374 | - }, | ||
| 375 | - hide: function(){ | ||
| 376 | - $('#captchaWrap').hide(); | ||
| 377 | - $('input[name=captcha]').val(''); | ||
| 378 | - } | ||
| 379 | - }; | ||
| 380 | - | ||
| 381 | - $('#captchaWrap img.captcha-img').on('click', function(){ | ||
| 382 | - $(this).attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 383 | - }); | ||
| 384 | - | ||
| 385 | - function error(rs){ | ||
| 386 | - return rs.status == 'ERROR' || rs.status == 500; | ||
| 387 | - } | ||
| 388 | - }(); | ||
| 389 | -</script> | ||
| 390 | -</body> | 1 | +<!DOCTYPE html> |
| 2 | +<html lang="zh"> | ||
| 3 | +<head> | ||
| 4 | + <meta name="renderer" content="webkit" /> | ||
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | + <meta charset="utf-8" /> | ||
| 7 | + <title>登录</title> | ||
| 8 | + <link | ||
| 9 | + href="/login_assets/css/font-awesome.min.css" | ||
| 10 | + rel="stylesheet" type="text/css" /> | ||
| 11 | + <!-- Bootstrap style --> | ||
| 12 | + <link href="/login_assets/css/bootstrap.min.css" | ||
| 13 | + rel="stylesheet" type="text/css" /> | ||
| 14 | + | ||
| 15 | + <!-- METRONIC style --> | ||
| 16 | + <link href="/login_assets/css/components.css" rel="stylesheet" | ||
| 17 | + type="text/css" /> | ||
| 18 | + | ||
| 19 | + <style type="text/css"> | ||
| 20 | + body>.wrapper { | ||
| 21 | + background-image: url(/login_assets/img/bg_9b9dcb65ff.png); | ||
| 22 | + background-size: 100px; | ||
| 23 | + background-repeat: repeat; | ||
| 24 | + min-height: 800px; | ||
| 25 | + min-width: 630px; | ||
| 26 | + position: absolute; | ||
| 27 | + top: 0; | ||
| 28 | + bottom: 0; | ||
| 29 | + left: 0; | ||
| 30 | + right: 0; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + #loginPanel.dialog-shadow { | ||
| 34 | + width: 450px; | ||
| 35 | + /* height: 400px; */ | ||
| 36 | + border: 1px solid #dadada; | ||
| 37 | + border-radius: 10px !important; | ||
| 38 | + position: absolute; | ||
| 39 | + box-shadow: 0 9px 30px -6px rgba(0, 0, 0, .2), 0 18px 20px -10px | ||
| 40 | + rgba(0, 0, 0, .04), 0 18px 20px -10px rgba(0, 0, 0, .04), 0 10px 20px | ||
| 41 | + -10px rgba(0, 0, 0, .04); | ||
| 42 | + background: url(/login_assets/img/dialog-gray-bg_42c40b3eb6.png) #fff bottom | ||
| 43 | + repeat-x; | ||
| 44 | + top: 50%; | ||
| 45 | + left: 50%; | ||
| 46 | + margin-left: -225px; | ||
| 47 | + margin-top: -300px; | ||
| 48 | + text-align: center; | ||
| 49 | + color: #333; | ||
| 50 | + opacity: .5; | ||
| 51 | + | ||
| 52 | + padding-bottom: 56px; | ||
| 53 | + | ||
| 54 | + animation: to_center 1s forwards; | ||
| 55 | + animation-delay: .2s; | ||
| 56 | + | ||
| 57 | + transition: all .3s ease; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @keyframes to_center | ||
| 61 | + { | ||
| 62 | + 0% {margin-top: -300px;opacity: .5;} | ||
| 63 | + 100% {margin-top: -270px;opacity: 1;} | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + | ||
| 67 | + h3 { | ||
| 68 | + font-size: 25px; | ||
| 69 | + font-weight: 600; | ||
| 70 | + color: #4a4a4a | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + .input-icon input { | ||
| 74 | + height: 48px; | ||
| 75 | + border-radius: 5px !important; | ||
| 76 | + transition: all .5s ease; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + .input-icon input:FOCUS { | ||
| 80 | + border-color: #c2cad8; | ||
| 81 | + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12) !important; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + .input-icon>i { | ||
| 85 | + margin-top: 16px; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + #loginPanel #loginBtn.btn{ | ||
| 89 | + border-radius: 6px !important; | ||
| 90 | + width: 378px; | ||
| 91 | + height: 48px; | ||
| 92 | + font-size: 20px; | ||
| 93 | + font-family: 微软雅黑; | ||
| 94 | + transition: all .3s ease; | ||
| 95 | + | ||
| 96 | + background: #5f7ed7; | ||
| 97 | + background: linear-gradient(#6f97e5,#527ed9); | ||
| 98 | + box-shadow: inset 0 1px 2px #7ea1e8 !important; | ||
| 99 | + color: #fff; | ||
| 100 | + text-shadow: #4f70b3 0 -1px 0; | ||
| 101 | + border: none; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + #loginPanel #loginBtn.btn:HOVER { | ||
| 105 | + box-shadow: inset 0 1px 1px #7696de,inset 0 0 2px #627dca,inset 0 -2px 3px #5a77c7,inset 0 0 100px rgba(48,77,147,.4) !important; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + #loginPanel.show_msg{ | ||
| 110 | + top: calc(50% - 10px); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + #loginPanel .alert{ | ||
| 114 | + display: none; | ||
| 115 | + padding: 12px; | ||
| 116 | + margin-top: 21px; | ||
| 117 | + border-radius: 0 0 10px 10px !important; | ||
| 118 | + font-size: 13px; | ||
| 119 | + | ||
| 120 | + position: absolute; | ||
| 121 | + width: 100%; | ||
| 122 | + border-bottom: 1px solid #dadada; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + #loginPanel .alert.login-success{ | ||
| 126 | + color: #27a4b0; | ||
| 127 | + background: #abe7ed; | ||
| 128 | + border-color: #abe7ed; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + #loginPanel .alert i{ | ||
| 132 | + font-size: 16px; | ||
| 133 | + vertical-align: middle; | ||
| 134 | + margin: 0 5px 3px; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + #loginPanel.show_msg .alert{ | ||
| 138 | + display: block; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + #captchaWrap{ | ||
| 142 | + display: none; | ||
| 143 | + text-align: left; | ||
| 144 | + border-top: 1px solid #f3f2f2; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + img.captcha-img{ | ||
| 148 | + cursor: pointer; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + .login-footer{ | ||
| 152 | + position: fixed; | ||
| 153 | + width: 100%; | ||
| 154 | + bottom: 35px; | ||
| 155 | + text-align: center; | ||
| 156 | + color: #a6a6a6; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + h3.logo-text{ | ||
| 160 | + font-family: 华文楷体,华文细黑; | ||
| 161 | + font-size: 28px; | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + .warn-note{ | ||
| 165 | + width: 100%; | ||
| 166 | + position: absolute; | ||
| 167 | + top: 0; | ||
| 168 | + z-index: 2; | ||
| 169 | + text-align: center; | ||
| 170 | + background: #ff4646; | ||
| 171 | + color: white; | ||
| 172 | + padding: 12px; | ||
| 173 | + display: none; | ||
| 174 | + } | ||
| 175 | + </style> | ||
| 176 | +</head> | ||
| 177 | + | ||
| 178 | +<body> | ||
| 179 | +<div class="warn-note">警告!系统目前仅在 WebKit 内核下完成兼容性测试,请使用 Google | ||
| 180 | + Chrome 浏览器进入系统。</div> | ||
| 181 | +<div class="wrapper ng-scope"> | ||
| 182 | + <div id="loginPanel" class="dialog dialog-shadow"> | ||
| 183 | + <br> | ||
| 184 | + <h3 class="logo-text">浦东公交调度系统</h3> | ||
| 185 | + <hr> | ||
| 186 | + <form style="padding: 0px 35px;"> | ||
| 187 | + <div class="form-group" style="margin-bottom: 0"> | ||
| 188 | + <label></label> | ||
| 189 | + <div class="input-icon"> | ||
| 190 | + <i class="fa fa-user font-gray"></i> <input type="text" | ||
| 191 | + name="userName" class="form-control" placeholder="输入用户名" | ||
| 192 | + autofocus="autofocus" autocomplete="off"> | ||
| 193 | + </div> | ||
| 194 | + </div> | ||
| 195 | + | ||
| 196 | + <div class="form-group"> | ||
| 197 | + <label></label> | ||
| 198 | + <div class="input-icon"> | ||
| 199 | + <i class="fa fa-key font-gray"></i> <input type="password" | ||
| 200 | + name="password" class="form-control" placeholder="输入密码" autocomplete="off"> | ||
| 201 | + </div> | ||
| 202 | + </div> | ||
| 203 | + | ||
| 204 | + <div class="form-group" id="captchaWrap"> | ||
| 205 | + <label></label> | ||
| 206 | + <div class="input-icon"> | ||
| 207 | + <input type="text" name="captcha" style="width: 153px !important;" | ||
| 208 | + class="form-control input-inline input-medium" | ||
| 209 | + placeholder="输入验证码" autocomplete="off"> <span class="help-inline"> <img | ||
| 210 | + alt="验证码" class="captcha-img" title="点击刷新验证码"> | ||
| 211 | + </span> | ||
| 212 | + </div> | ||
| 213 | + </div> | ||
| 214 | + </form> | ||
| 215 | + <br> | ||
| 216 | + <br> | ||
| 217 | + <div class="form-actions"> | ||
| 218 | + <button class="btn blue-steel" id="loginBtn" disabled="disabled">登录</button> | ||
| 219 | + </div> | ||
| 220 | + | ||
| 221 | + <div class="alert alert-danger"></div> | ||
| 222 | + </div> | ||
| 223 | + | ||
| 224 | + <div class="login-footer">© 2016 上海巴士拓华科技发展有限公司 Some Rights | ||
| 225 | + Reserved</div> | ||
| 226 | +</div> | ||
| 227 | + | ||
| 228 | +<script> | ||
| 229 | + delete window.require; | ||
| 230 | + delete window.exports; | ||
| 231 | + delete window.module; | ||
| 232 | +</script> | ||
| 233 | +<!-- jQuery --> | ||
| 234 | +<script src="/login_assets/js/jquery.min.js"></script> | ||
| 235 | +<script src="/login_assets/js/jsencrypt.min.js"></script> | ||
| 236 | +<script> | ||
| 237 | + window.onload=function(){ | ||
| 238 | + var body=document.getElementsByTagName("body")[0]; | ||
| 239 | + if(typeof body.style.WebkitAnimation=="undefined") | ||
| 240 | + $('.warn-note').fadeIn(); | ||
| 241 | + }; | ||
| 242 | + !function(){ | ||
| 243 | + var form = $('#loginPanel form') | ||
| 244 | + ,nameInput = $('input[name=userName]', form) | ||
| 245 | + ,pwdInput = $('input[name=password]', form) | ||
| 246 | + ,msgAlert = $('#loginPanel .alert-danger'); | ||
| 247 | + | ||
| 248 | + $('input', form).on('keyup', checkBtnStatus); | ||
| 249 | + | ||
| 250 | + var keys; | ||
| 251 | + $.get('/user/login/jCryptionKey?t='+Math.random(), function(data){ | ||
| 252 | + keys = data.publickey; | ||
| 253 | + }); | ||
| 254 | + | ||
| 255 | + | ||
| 256 | + | ||
| 257 | + function checkBtnStatus(){ | ||
| 258 | + var es = $('input:visible', form); | ||
| 259 | + for(var i = 0, e; e = es[i++];){ | ||
| 260 | + if($.trim($(e).val()) == ''){ | ||
| 261 | + $('#loginBtn').attr('disabled', 'disabled'); | ||
| 262 | + $('#loginPanel').removeClass('show_msg'); | ||
| 263 | + return; | ||
| 264 | + } | ||
| 265 | + } | ||
| 266 | + $('#loginBtn').removeAttr('disabled'); | ||
| 267 | + } | ||
| 268 | + | ||
| 269 | + nameInput.on('blur', checkStatus); | ||
| 270 | + //keyup 事件做延迟 | ||
| 271 | + var uNameKeyup; | ||
| 272 | + nameInput.on('keyup', function(){ | ||
| 273 | + if(uNameKeyup) | ||
| 274 | + return; | ||
| 275 | + uNameKeyup = true; | ||
| 276 | + setTimeout(function(){ | ||
| 277 | + checkStatus(); | ||
| 278 | + uNameKeyup = false; | ||
| 279 | + }, 200); | ||
| 280 | + }); | ||
| 281 | + | ||
| 282 | + //密码框回车事件 | ||
| 283 | + pwdInput.on('keyup', function(e){ | ||
| 284 | + if (e.keyCode == 13) | ||
| 285 | + $('#loginBtn').click(); | ||
| 286 | + }); | ||
| 287 | + //验证码框回车事件 | ||
| 288 | + $('input[name=captcha]').on('keyup', function(e){ | ||
| 289 | + if (e.keyCode == 13) | ||
| 290 | + $('#loginBtn').click(); | ||
| 291 | + }); | ||
| 292 | + | ||
| 293 | + $('#loginBtn').on('click', function(){ | ||
| 294 | + if(lock || $(this).attr('disabled')) return; | ||
| 295 | + var userName = nameInput.val() | ||
| 296 | + ,pwd = pwdInput.val(); | ||
| 297 | + | ||
| 298 | + //RSA加密 | ||
| 299 | + var encrypt = new JSEncrypt(); | ||
| 300 | + encrypt.setPublicKey(keys); | ||
| 301 | + userName = encrypt.encrypt(userName); | ||
| 302 | + pwd = encrypt.encrypt(pwd); | ||
| 303 | + //登录 | ||
| 304 | + login(userName, pwd); | ||
| 305 | + }); | ||
| 306 | + | ||
| 307 | + var lock; | ||
| 308 | + function login(userName, pwd){ | ||
| 309 | + lock = true; | ||
| 310 | + $('#loginBtn').attr('disabled', 'disabled'); | ||
| 311 | + | ||
| 312 | + var params = { | ||
| 313 | + userName: userName, | ||
| 314 | + password: pwd, | ||
| 315 | + captcha: $('input[name=captcha]').val() | ||
| 316 | + }; | ||
| 317 | + $.post('/user/login', params | ||
| 318 | + ,function(rs){ | ||
| 319 | + | ||
| 320 | + $('#loginPanel').addClass('show_msg'); | ||
| 321 | + if(error(rs)){ | ||
| 322 | + lock = false; | ||
| 323 | + $('#loginBtn').removeAttr('disabled'); | ||
| 324 | + msgAlert.html('<i class="fa fa-times-circle"> </i> 登录失败,' + rs.msg); | ||
| 325 | + | ||
| 326 | + _captcha.refresh(); | ||
| 327 | + checkStatus(); | ||
| 328 | + } | ||
| 329 | + else{ | ||
| 330 | + msgAlert.html('<i class="fa fa-check"> </i> 登录成功!'); | ||
| 331 | + msgAlert.addClass('login-success'); | ||
| 332 | + window.location.href = '/'; | ||
| 333 | + } | ||
| 334 | + }); | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + function checkStatus(){ | ||
| 338 | + var t = nameInput.val(); | ||
| 339 | + if(!t){ | ||
| 340 | + hide(); | ||
| 341 | + return; | ||
| 342 | + } | ||
| 343 | + | ||
| 344 | + $.get('/user/login/captchaStatus', {userName: t}, function(rs){ | ||
| 345 | + if(rs > 1) | ||
| 346 | + _captcha.show(); | ||
| 347 | + else | ||
| 348 | + hide(); | ||
| 349 | + }); | ||
| 350 | + | ||
| 351 | + function hide(){ | ||
| 352 | + if(!$("#captchaWrap").is(":hidden")){ | ||
| 353 | + _captcha.hide(); | ||
| 354 | + //隐藏提示消息 | ||
| 355 | + //msgAlert.html(''); | ||
| 356 | + //$('#loginPanel').removeClass('show_msg'); | ||
| 357 | + } | ||
| 358 | + } | ||
| 359 | + } | ||
| 360 | + | ||
| 361 | + | ||
| 362 | + var _captcha = { | ||
| 363 | + show: function(){ | ||
| 364 | + if($("#captchaWrap").is(":hidden")){ | ||
| 365 | + $('#captchaWrap').fadeIn(500); | ||
| 366 | + _captcha.refresh(); | ||
| 367 | + checkBtnStatus(); | ||
| 368 | + } | ||
| 369 | + }, | ||
| 370 | + refresh: function(){ | ||
| 371 | + if($("#captchaWrap").is(":hidden")) | ||
| 372 | + return; | ||
| 373 | + $('#captchaWrap img.captcha-img').attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 374 | + }, | ||
| 375 | + hide: function(){ | ||
| 376 | + $('#captchaWrap').hide(); | ||
| 377 | + $('input[name=captcha]').val(''); | ||
| 378 | + } | ||
| 379 | + }; | ||
| 380 | + | ||
| 381 | + $('#captchaWrap img.captcha-img').on('click', function(){ | ||
| 382 | + $(this).attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 383 | + }); | ||
| 384 | + | ||
| 385 | + function error(rs){ | ||
| 386 | + return rs.status == 'ERROR' || rs.status == 500; | ||
| 387 | + } | ||
| 388 | + }(); | ||
| 389 | +</script> | ||
| 390 | +</body> | ||
| 391 | </html> | 391 | </html> |
| 392 | \ No newline at end of file | 392 | \ No newline at end of file |