login.htmlback 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>登录</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. }
  23. :root {
  24. --Form-item-gap: 1.3rem;
  25. --InputGroup-height: 2.5rem;
  26. --Button-height: 2.5rem;
  27. --InputGroup-paddingX: .6rem;
  28. --InputGroup-addOn-bg: var(--Form-input-bg);
  29. /* --fontSizeBase: .9rem; */
  30. }
  31. .app-wrapper {
  32. position: relative;
  33. width: 100%;
  34. height: 100%;
  35. margin: 0;
  36. padding: 0;
  37. }
  38. .loginTitle {
  39. text-align: center;
  40. }
  41. .loginTitle p {
  42. margin: 10px auto;
  43. color: black;
  44. font-size: 25px;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <div id="root" class="app-wrapper"></div>
  50. <script type='text/javascript' src='./public/static/amis-sdk/sdk.js'></script>
  51. <script type="text/javascript">
  52. (function () {
  53. let amis = amisRequire('amis/embed');
  54. const amisJSON = {
  55. type: 'page',
  56. title: "",
  57. style: {
  58. "backgroundImage": "linear-gradient(180deg, #86a4e9, transparent)"
  59. },
  60. cssVars: {
  61. "--Form-input-onFocused-borderColor": "#e8e9eb",
  62. "--Form-input-onHover-borderColor": "#e8e9eb",
  63. },
  64. body: {
  65. "type": "grid-2d",
  66. "cols": 12,
  67. "grids": [{
  68. x: 5,
  69. y: 5,
  70. h: 1,
  71. w: 4,
  72. width: 200,
  73. type: 'form',
  74. mode: 'horizontal',
  75. title: "",
  76. api: {
  77. url: "/api/new-login",
  78. method: "post",
  79. dataType: "form-data",
  80. adaptor: function(payload, response, api) {
  81. }
  82. },
  83. panelClassName: "p-r p-l p-b-md",
  84. redirect: "/admins",
  85. body: [{
  86. "type": "tpl",
  87. "tpl": "<div class='loginTitle'><p>管理后台</p></div>"
  88. },
  89. {
  90. type: "input-text",
  91. label: false,
  92. name: "userName",
  93. size: "full",
  94. placeholder: "登录名",
  95. addOn: {
  96. "label": "",
  97. "type": "text",
  98. "position": "left",
  99. "icon": "fa fa-user"
  100. },
  101. },
  102. {
  103. type: "input-password",
  104. label: false,
  105. name: "password",
  106. size: "full",
  107. placeholder: "密码",
  108. addOn: {
  109. "label": "",
  110. "type": "text",
  111. "position": "left",
  112. "icon": "fa fa-lock"
  113. },
  114. },
  115. {
  116. type: "control",
  117. label: false,
  118. body: {
  119. "type": "button",
  120. "level": "primary",
  121. "actionType": "submit",
  122. "block": true,
  123. "label": "登录"
  124. }
  125. }
  126. ]
  127. }
  128. ]
  129. }
  130. };
  131. let amisScoped = amis.embed('#root', amisJSON);
  132. })();
  133. </script>
  134. </body>
  135. </html>