login-config-totp.ftl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. }
  12. html,
  13. body {
  14. width: 100%;
  15. height: 100%;
  16. }
  17. body {
  18. box-sizing: border-box;
  19. -moz-osx-font-smoothing: grayscale;
  20. -webkit-font-smoothing: antialiased;
  21. text-rendering: optimizeLegibility;
  22. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
  23. background-color: #F4F7FB;
  24. }
  25. *,
  26. *::before,
  27. *::after {
  28. box-sizing: inherit;
  29. }
  30. a {
  31. border: none;
  32. outline: none;
  33. text-decoration: none;
  34. -webkit-touch-callout: none;
  35. -webkit-tap-highlight-color: transparent;
  36. }
  37. .c-login {
  38. display: flex;
  39. min-height: 100%;
  40. width: 100%;
  41. }
  42. .c-login__img {
  43. flex: 1 0 400px;
  44. display: inline-block;
  45. max-width: 800px;
  46. background: url("${url.resourcesPath}/img/illustration.png") 50% 50% / 757px 613px no-repeat;
  47. }
  48. .c-login__main {
  49. flex: 1 0 auto;
  50. }
  51. .c-login-form {
  52. display: inline-flex;
  53. flex-direction: column;
  54. justify-content: center;
  55. align-items: center;
  56. padding: 40px 0 80px;
  57. background-color: #FFFFFF;
  58. overflow: auto;
  59. }
  60. .c-login-form__header {
  61. display: inline-flex;
  62. align-items: center;
  63. }
  64. .c-login-form__logo {
  65. flex: none;
  66. }
  67. .c-login-form__name {
  68. margin-left: 16px;
  69. color: #1C5CB0;
  70. font-size: 28px;
  71. font-weight: bold;
  72. line-height: 1;
  73. }
  74. .c-login-form__title {
  75. padding: 36px 0 24px;
  76. color: #1C5CB0;
  77. font-size: 18px;
  78. font-weight: bold;
  79. }
  80. .c-login-form__info {
  81. width: 400px;
  82. color: #333333;
  83. font-size: 14px;
  84. line-height: 20px;
  85. }
  86. .c-login-form__info ol {
  87. line-height: 24px;
  88. }
  89. .c-login-form__qr {
  90. width: 144px;
  91. height: 144px;
  92. }
  93. .c-login-form__retry {
  94. color: #1C5CB0;
  95. font-size: 12px;
  96. }
  97. .c-login-form__required {
  98. color: #EF1D1D;
  99. }
  100. .c-login-form__required ::before {
  101. content: "*";
  102. color: #FF0000;
  103. font-size: 14px;
  104. }
  105. .c-login-form__input {
  106. padding: 0 10px;
  107. margin-top: 6px;
  108. width: 240px;
  109. height: 30px;
  110. font-size: 14px;
  111. line-height: 30px;
  112. border: 1px solid #C4C4C4;
  113. outline: none;
  114. }
  115. .c-login-form__error {
  116. height: 30px;
  117. color: #F56C6C;
  118. font-size: 12px;
  119. line-height: 24px;
  120. white-space: nowrap;
  121. }
  122. .c-login-form__submit {
  123. display: inline-flex;
  124. justify-content: center;
  125. align-items: center;
  126. height: 40px;
  127. padding: 0 40px;
  128. color: #ffffff;
  129. font-size: 18px;
  130. border: none;
  131. background-color: #1C5CB0;
  132. border-radius: 8px;
  133. cursor: pointer;
  134. }
  135. .c-login-form__submit[disabled] {
  136. background-color: #C4C4C4;
  137. }
  138. .l-flex {
  139. display: flex;
  140. align-items: flex-start;
  141. gap: 16px;
  142. }
  143. @media screen and (max-width: 900px) {
  144. .c-login__img {
  145. display: none;
  146. }
  147. }
  148. @media screen and (max-height: 800px) {
  149. .c-login-form {
  150. padding: 0;
  151. }
  152. .c-login-form__title {
  153. padding: 24px 0 16px;
  154. }
  155. }
  156. </style>
  157. </head>
  158. <body>
  159. <div class="c-login">
  160. <div class="c-login__img"></div>
  161. <form class="c-login__main c-login-form" action="${url.loginAction}" method="post"
  162. onsubmit="login.disabled = true; return true;">
  163. <input id="totpSecret" type="hidden" name="totpSecret" value="${totp.totpSecret}" />
  164. <#if mode??>
  165. <input id="mode" type="hidden" name="mode" value="${mode}" />
  166. </#if>
  167. <div class="c-login-form__header">
  168. <img class="c-login-form__logo" src="${url.resourcesPath}/img/logo/${realm.displayNameHtml!'inspur.png'}" />
  169. <div class="c-login-form__name">${realm.displayName}</div>
  170. </div>
  171. <div class="c-login-form__title">手机验证</div>
  172. <div class="c-login-form__info">
  173. <ol>
  174. <li>请先使用微信搜索小程序“浪潮安播云”进入“我的-OTP”,或扫描下面右侧小程序码。</li>
  175. <li>打开应用后扫描下面左侧二维码。</li>
  176. <li>输入应用提供的一次性码,点击提交完成验证。</li>
  177. </ol>
  178. <br />
  179. <div class="l-flex">
  180. <div>
  181. <img class="c-login-form__qr" src="data:image/png;base64,${totp.totpSecretQrCode}" />
  182. <p>
  183. <a class="c-login-form__retry" href="${totp.manualUrl}">
  184. 无法扫码
  185. </a>
  186. </p>
  187. </div>
  188. <img class="c-login-form__qr" src="${url.resourcesPath}/img/applet.png" />
  189. </div>
  190. <br />
  191. <p class="c-login-form__required">一次性验证码</p>
  192. <input type="text" name="totp" class="c-login-form__input" autocomplete="off" />
  193. <div class="c-login-form__error">
  194. <#if messagesPerField.existsError('totp')>
  195. ${kcSanitize(messagesPerField.get('totp'))?no_esc}
  196. </#if>
  197. </div>
  198. <input type="submit" name="login" class="c-login-form__submit" value="提交">
  199. </div>
  200. </form>
  201. </div>
  202. </body>
  203. </html>