login.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {template 'common/header-base'}
  2. <div class="system-login" >
  3. {if !empty($_W['setting']['copyright']['background_img'])}
  4. <img src="{php echo to_global_media($_W['setting']['copyright']['background_img']);}" class="bg-img" width="100%"/>
  5. {else}
  6. <img src="./resource/images/bg-login.png" class="bg-img"/>
  7. {/if}
  8. <div class="head">
  9. <a href="/" class="logo-version">
  10. <img src="{if !empty($_W['setting']['copyright']['flogo'])}{php echo to_global_media($_W['setting']['copyright']['flogo'])}{else}./resource/images/logo/login-logo.png{/if}" class="logo">
  11. <span class="version hidden">{IMS_VERSION}</span>
  12. </a>
  13. {if !empty($_W['setting']['copyright']['showhomepage'])}
  14. <a href="{php echo url('account/welcome')}" class="pull-right">首页</a>
  15. {/if}
  16. </div>
  17. <div class="login-panel">
  18. <div class="title">
  19. <a href="javascript:void(0);">账号/手机登录</a>
  20. </div>
  21. <form action="" method="post" role="form" id="form1" onsubmit="return formcheck();" class="we7-form">
  22. <div class="input-group-vertical">
  23. <input name="login_type" type="hidden" class="form-control " value="system">
  24. <input name="referer" type="hidden" value="{$_GPC['referer']}">
  25. <input name="username" type="text" class="form-control " placeholder="请输入用户名/手机登录">
  26. <input name="password" id="password" type="password" class="form-control password" placeholder="请输入登录密码">
  27. <span style="display:none;color:red;">大写锁定已打开</span>
  28. {if !empty($_W['setting']['copyright']['verifycode'])}
  29. <div class="input-group">
  30. <input name="verify" type="text" class="form-control" placeholder="请输入验证码">
  31. <a href="javascript:;" id="toggle" class="input-group-btn imgverify"><img id="imgverify" src="{php echo url('utility/code')}" title="点击图片更换验证码" /></a>
  32. </div>
  33. {/if}
  34. </div>
  35. <div class="form-inline" style="margin-bottom: 15px;">
  36. <div class="pull-right">
  37. <a href="{url 'user/find-password'}" target="_blank" class="color-default"></a>
  38. </div>
  39. <div class="checkbox">
  40. <input type="checkbox" value="true" id="rember" name="rember">
  41. <label for="rember">记住用户名</label>
  42. </div>
  43. </div>
  44. <div class="login-submit text-center">
  45. <input type="submit" id="submit" name="submit" value="登录" class="btn btn-primary btn-block" />
  46. <div class="text-right">
  47. {if !$_W['siteclose'] && $setting['register']['open']}
  48. {if empty($_GPC['login_type']) || $_GPC['login_type'] == 'system'}
  49. <a href="{url 'user/register'}" class="color-default">立即注册</a>
  50. {/if}
  51. {/if}
  52. {if !$_W['siteclose'] && !empty($_W['setting']['copyright']['mobile_status'])}
  53. {if $_GPC['login_type'] == 'mobile'}
  54. <a href="{php echo url('user/register', array('register_type' => 'mobile'))}" class="color-default">立即注册</a>
  55. {/if}
  56. {/if}
  57. </div>
  58. <input name="token" value="{$_W['token']}" type="hidden" />
  59. </div>
  60. {if !empty($setting['thirdlogin']['qq']['authstate']) || !empty($setting['thirdlogin']['wechat']['authstate'])}
  61. <div class="text-center">
  62. <span class="color-gray">使用第三方账号登录</span>
  63. <div class="form-control-static">
  64. {if !empty($setting['thirdlogin']['qq']['authstate'])}<a href="{$login_urls['qq']}"><img src="./resource/images/qqlogin.png" width="35px"></a>&nbsp;&nbsp;{/if}
  65. {if !empty($setting['thirdlogin']['wechat']['authstate'])}<a href="{$login_urls['wechat']}"><img src="./resource/images/wxlogin.png" width="35px"></a>{/if}
  66. </div>
  67. </div>
  68. {/if}
  69. </form>
  70. </div>
  71. </div>
  72. {template 'common/footer'}
  73. <script>
  74. function detectCapsLock(event) {
  75. var e = event || window.event;
  76. var o = e.target || e.srcElement;
  77. var oTip = o.nextElementSibling;
  78. var keyCode = e.keyCode || e.switch;
  79. var isShift = e.shiftKey || (keyCode == 16) || false;
  80. if (((keyCode >= 65 && keyCode <= 90) && !isShift) || ((keyCode >= 97 && keyCode <= 122) && isShift)) {
  81. oTip.style.display = '';
  82. } else {
  83. oTip.style.display = 'none';
  84. }
  85. }
  86. document.getElementById('password').onkeypress = detectCapsLock;
  87. function formcheck() {
  88. if($('#remember:checked').length == 1) {
  89. cookie.set('remember-username', $(':text[name="username"]').val());
  90. } else {
  91. cookie.del('remember-username');
  92. }
  93. return true;
  94. }
  95. var h = document.documentElement.clientHeight;
  96. if($('.footer').length) {
  97. h = h - $('.footer').outerHeight();
  98. }
  99. $(".system-login").css('height',h);
  100. $('#toggle').click(function() {
  101. $('#imgverify').prop('src', '{php echo url('utility/code')}r='+Math.round(new Date().getTime()));
  102. return false;
  103. });
  104. {if !empty($_W['setting']['copyright']['verifycode'])}
  105. $('#form1').submit(function() {
  106. var verify = $(':text[name="verify"]').val();
  107. if (verify == '') {
  108. alert('请填写验证码');
  109. return false;
  110. }
  111. });
  112. {/if}
  113. </script>