login-otp.ftl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name='viewport' content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no' />
  6. <title>${realm.displayName}</title>
  7. <link rel="stylesheet" href="${url.resourcesPath}/css/totp.css" />
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. html,
  14. body {
  15. width: 100%;
  16. height: 100%;
  17. }
  18. body {
  19. box-sizing: border-box;
  20. -moz-osx-font-smoothing: grayscale;
  21. -webkit-font-smoothing: antialiased;
  22. text-rendering: optimizeLegibility;
  23. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
  24. background-color: #F4F7FB;
  25. }
  26. *,
  27. *::before,
  28. *::after {
  29. box-sizing: inherit;
  30. }
  31. a {
  32. border: none;
  33. outline: none;
  34. text-decoration: none;
  35. -webkit-touch-callout: none;
  36. -webkit-tap-highlight-color: transparent;
  37. }
  38. .c-login {
  39. display: flex;
  40. min-height: 100%;
  41. width: 100%;
  42. }
  43. .c-login__img {
  44. flex: 1 0 400px;
  45. display: inline-block;
  46. max-width: 800px;
  47. background: url("${url.resourcesPath}/img/illustration.png") 50% 50% / 757px 613px no-repeat;
  48. }
  49. .c-login__main {
  50. flex: 1 0 auto;
  51. }
  52. .c-login-form {
  53. display: inline-flex;
  54. flex-direction: column;
  55. justify-content: center;
  56. align-items: center;
  57. padding: 40px 0 80px;
  58. background-color: #FFFFFF;
  59. overflow: auto;
  60. }
  61. .c-login-form__header {
  62. display: inline-flex;
  63. align-items: center;
  64. }
  65. .c-login-form__logo {
  66. flex: none;
  67. }
  68. .c-login-form__name {
  69. margin-left: 16px;
  70. color: #1C5CB0;
  71. font-size: 28px;
  72. font-weight: bold;
  73. line-height: 1;
  74. }
  75. .c-login-form__title {
  76. padding: 36px 0 24px;
  77. color: #1C5CB0;
  78. font-size: 18px;
  79. font-weight: bold;
  80. }
  81. .c-login-form__info {
  82. width: 400px;
  83. color: #333333;
  84. font-size: 16px;
  85. line-height: 20px;
  86. }
  87. .c-login-form__required {
  88. color: #EF1D1D;
  89. }
  90. .c-login-form__required ::before {
  91. content: "*";
  92. color: #FF0000;
  93. font-size: 14px;
  94. }
  95. .c-login-form__input {
  96. padding: 0 10px;
  97. margin-top: 6px;
  98. width: 240px;
  99. height: 30px;
  100. font-size: 14px;
  101. line-height: 30px;
  102. border: 1px solid #C4C4C4;
  103. outline: none;
  104. }
  105. .c-login-form__error {
  106. height: 30px;
  107. color: #F56C6C;
  108. font-size: 12px;
  109. line-height: 24px;
  110. white-space: nowrap;
  111. }
  112. .c-login-form__submit {
  113. display: inline-flex;
  114. justify-content: center;
  115. align-items: center;
  116. height: 40px;
  117. padding: 0 40px;
  118. color: #ffffff;
  119. font-size: 18px;
  120. border: none;
  121. background-color: #1C5CB0;
  122. border-radius: 8px;
  123. cursor: pointer;
  124. }
  125. .c-login-form__submit[disabled] {
  126. background-color: #C4C4C4;
  127. }
  128. @media screen and (max-width: 900px) {
  129. .c-login__img {
  130. display: none;
  131. }
  132. }
  133. </style>
  134. </head>
  135. <body>
  136. <div class="c-login">
  137. <div class="c-login__img"></div>
  138. <form
  139. class="c-login__main c-login-form"
  140. action="${url.loginAction}"
  141. method="post"
  142. onsubmit="login.disabled = true; return true;"
  143. >
  144. <div class="c-login-form__header">
  145. <img class="c-login-form__logo" src="${url.resourcesPath}/img/logo/${realm.displayNameHtml!'inspur.png'}">
  146. <div class="c-login-form__name">${realm.displayName}</div>
  147. </div>
  148. <div class="c-login-form__title">手机验证</div>
  149. <div class="c-login-form__info">
  150. <p class="c-login-form__required">一次性验证码</p>
  151. <input
  152. type="text"
  153. name="otp"
  154. class="c-login-form__input"
  155. autocomplete="off"
  156. />
  157. <div class="c-login-form__error">
  158. <#if messagesPerField.existsError('totp')>
  159. ${kcSanitize(messagesPerField.get('totp'))?no_esc}
  160. </#if>
  161. </div>
  162. <input
  163. type="submit"
  164. name="login"
  165. class="c-login-form__submit"
  166. value="提交"
  167. >
  168. </div>
  169. </form>
  170. </div>
  171. </body>
  172. </html>