login.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Roma</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <link rel="icon" type="image/x-ico" href=""/>
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  9. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  10. <link rel="stylesheet" href="./public/static/amis-sdk/helper.css">
  11. <link rel="stylesheet" href="./public/static/amis-sdk/sdk.css">
  12. <style>
  13. html,
  14. body,
  15. .app-wrapper {
  16. /* position: relative; */
  17. width: 100%;
  18. height: 100%;
  19. margin: 0;
  20. padding: 0;
  21. touch-action: pan-y;
  22. overflow: hidden;
  23. }
  24. :root {
  25. --Form-item-gap: 1.3rem;
  26. --InputGroup-height: 2.5rem;
  27. --Button-height: 2.5rem;
  28. --InputGroup-paddingX: .6rem;
  29. --InputGroup-addOn-bg: var(--Form-input-bg);
  30. /* --fontSizeBase: .9rem; */
  31. }
  32. .app-wrapper {
  33. /* position: relative; */
  34. width: 100%;
  35. height: 100%;
  36. margin: 0;
  37. padding: 0;
  38. }
  39. .amis-scope .cxd-Icon{height: 1rem}
  40. .amis-scope .cxd-TextControl-input input{height: 100% !important;}
  41. .amis-scope .cxd-TextControl-input:hover{border:var(--Form-input-borderWidth) solid var(--Form-input-borderColor)}
  42. .amis-scope .cxd-InputGroup .cxd-TextControl-input{border-left-width: 0;padding-left: 0;}
  43. .code_img{cursor: pointer;}
  44. .amis-scope .cxd-Form{
  45. font-size: var(--Form-fontSize);
  46. position: none !important;
  47. max-width: 700px;
  48. margin: 0 auto;
  49. margin-top: 10vh;
  50. /* position:; */
  51. }
  52. .amis-scope .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
  53. width: 100%;
  54. height: 100%;
  55. }
  56. .amis-scope h1 {
  57. font-size: 4vw;
  58. }
  59. @media (max-width: 768px) {
  60. .amis-scope .cxd-Form{
  61. font-size: var(--Form-fontSize);
  62. position: none !important;
  63. margin: 0 auto;
  64. margin-top: 0vh;
  65. /* position:; */
  66. }
  67. .amis-scope .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
  68. padding: 0;
  69. }
  70. }
  71. .amis-scope .cxd-Button--default {
  72. border: none;
  73. outline: none;
  74. }
  75. .amis-scope .cxd-Button--default:not(:disabled):not(.is-disabled):hover {
  76. color: none;
  77. background: none;
  78. border-color: none;
  79. border-width: none;
  80. border-style: none;
  81. box-shadow: none;
  82. border: none;
  83. outline: none;
  84. }
  85. .amis-scope .m-r-xs {
  86. margin-top:-5px;
  87. width: 30px;
  88. height: 30px;
  89. }
  90. .amis-scope .cxd-Form .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
  91. height: 1%;
  92. }
  93. </style>
  94. </head>
  95. <body>
  96. <div id="root" class="app-wrapper"></div>
  97. <script type='text/javascript' src='./public/static/amis-sdk/sdk.js'></script>
  98. <script src="./lang/en-US.js"></script>
  99. <script src="./lang/zh-CN.js"></script>
  100. <script src="./pages/login/login-json.js"></script>
  101. <script type="text/javascript">
  102. (function () {
  103. let amis = amisRequire('amis/embed');
  104. // 引入语言包内容
  105. let enUSLocale = enUs()
  106. let zhCNLocale = zhCn()
  107. //多语言映射
  108. const languageMap = {
  109. "en-US": {
  110. register: enUSLocale.register,
  111. replaceText: enUSLocale.replaceText,
  112. langReplaceTextIgnoreKeys: enUSLocale.langReplaceTextIgnoreKeys
  113. },
  114. "zh-CN": {
  115. register: zhCNLocale.register,
  116. replaceText: zhCNLocale.replaceText,
  117. langReplaceTextIgnoreKeys: zhCNLocale.langReplaceTextIgnoreKeys
  118. }
  119. }
  120. // 缓存中设置的语言
  121. let lang = localStorage.getItem('language')
  122. //内置组件的翻译信息
  123. let langRegister = {}
  124. //json配置的全文翻译信息
  125. let langReplaceText = {}
  126. //需要忽略json配置的全文替换key
  127. let langReplaceTextIgnoreKeys = {}
  128. if (undefined !== languageMap[lang]) {
  129. langRegister = languageMap[lang].register
  130. langReplaceText = languageMap[lang].replaceText
  131. langReplaceTextIgnoreKeys = languageMap[lang].langReplaceTextIgnoreKeys
  132. } else {
  133. // 未找到默认中文
  134. lang = 'zh-CN'
  135. }
  136. // 没有替换或忽略替换配置,则为{}
  137. if (undefined !== langReplaceText && Object.keys(langReplaceText).length !== 0) {
  138. } else {
  139. langReplaceText = {}
  140. }
  141. if (undefined !== langReplaceTextIgnoreKeys && Object.keys(langReplaceTextIgnoreKeys).length !== 0) {
  142. } else {
  143. langReplaceTextIgnoreKeys = {}
  144. }
  145. // 页面json内容
  146. const amisJSON = getLoginJson()
  147. let amisScoped = amis.embed(
  148. '#root',
  149. amisJSON,
  150. {
  151. locale: lang
  152. },
  153. {
  154. replaceText: langReplaceText,
  155. langReplaceTextIgnoreKeys: langReplaceTextIgnoreKeys
  156. }
  157. );
  158. })();
  159. // 刷新验证码
  160. function refresh_code()
  161. {
  162. document.querySelector('.code_img').src = '/login/verify?' + Math.random();
  163. }
  164. // 设置多语言
  165. function setLanguage() {
  166. }
  167. </script>
  168. </body>
  169. </html>