login-json.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. function getLoginJson() {
  2. let headerJson = {
  3. "type": "wrapper",
  4. "className": "fixed login_layout m:h-screen m:w-full bg-gray-50",
  5. "body": {
  6. "type": "form",
  7. "className": "h-full pc:p-9 m:p-4 m:pt-20",
  8. "api": {
  9. "method":"post",
  10. "url":"/login",
  11. "adaptor": function (data) {
  12. if (data.status !== 0) {
  13. // 登录请求提交后,刷新验证码
  14. refresh_code();
  15. }
  16. return data;
  17. },
  18. },
  19. "redirect": "/",
  20. "wrapWithPanel": false,
  21. "body": [
  22. {
  23. "type": "wrapper",
  24. "body": [
  25. {
  26. "type": "flex",
  27. "justify": "flex-end",
  28. "items": [
  29. {
  30. "type": "dropdown-button",
  31. "label": "",
  32. "className": "header-menu",
  33. "buttons": [
  34. {
  35. "type": "button",
  36. "label": "中文",
  37. "id": "u:6911502c8fcc",
  38. "onEvent": {
  39. "click": {
  40. "actions": [
  41. {
  42. "script": "localStorage.setItem('language', 'zh-CN')\nlocation.reload()",
  43. "actionType": "custom",
  44. "args": {
  45. }
  46. }
  47. ],
  48. "weight": 0
  49. }
  50. }
  51. },
  52. {
  53. "type": "button",
  54. "label": "English",
  55. "id": "u:e702685a7a45",
  56. "onEvent": {
  57. "click": {
  58. "actions": [
  59. {
  60. "script": "localStorage.setItem('language', 'en-US')\r\nlocation.reload()",
  61. "actionType": "custom"
  62. }
  63. ],
  64. "weight": 0
  65. }
  66. },
  67. "actionType": "",
  68. "link": "/view/user_info"
  69. }
  70. ],
  71. "id": "u:4fedf7a987bf",
  72. "size": "md",
  73. "level": "default",
  74. "align": "right",
  75. "block": false,
  76. "hideCaret": true,
  77. "trigger": "hover",
  78. "icon": "./public/static/icon/language-change.png",
  79. "btnClassName": "no-border"
  80. }
  81. ],
  82. "id": "u:e7752d0c1dbe"
  83. }
  84. ],
  85. "id": "u:d16525b6aae6",
  86. "asideResizor": false,
  87. "pullRefresh": {
  88. "disabled": true
  89. }
  90. },
  91. {
  92. "type":"html",
  93. "className":"text-center",
  94. "html":"<h1 class='title-name'>Roma 平台</h1>"
  95. },
  96. {
  97. "type": "input-group",
  98. "label": "",
  99. "body": [
  100. {
  101. "type": "icon",
  102. "icon": "./public/static/icon/shield-user-line.svg"
  103. },
  104. {
  105. "type": "input-text",
  106. "label": false,
  107. "placeholder": "用户名",
  108. "name": "name",
  109. "required": true
  110. }
  111. ]
  112. },
  113. {
  114. "type": "input-group",
  115. "label": "",
  116. "body": [
  117. {
  118. "type": "icon",
  119. "icon": "./public/static/icon/lock-password-line.svg",
  120. },
  121. {
  122. "type": "input-password",
  123. "label": false,
  124. "placeholder": "密码",
  125. "name": "pwd",
  126. "required": true
  127. }
  128. ]
  129. },
  130. {
  131. "type": "input-group",
  132. "label": "",
  133. "body": [
  134. {
  135. "type": "icon",
  136. "icon": "./public/static/icon/shield-check-line.svg"
  137. },
  138. {
  139. "type": "input-text",
  140. "label": false,
  141. "placeholder": "验证码",
  142. "name": "code",
  143. "required": true
  144. },
  145. {
  146. "type": "action",
  147. "body": {
  148. "type": "image",
  149. "height": "38px",
  150. "width": "110px",
  151. "name":"codeUrl",
  152. "imageClassName":"code_img b-none",
  153. "imageMode":"original",
  154. "src": "/login/verify"
  155. },
  156. // 点击图片 刷新二维码
  157. "onClick": "refresh_code()"
  158. }
  159. ]
  160. },
  161. {
  162. "label": "登 录",
  163. "type": "action",
  164. "actionType": "submit",
  165. "level": "primary",
  166. "className":"w-full h-2.5",
  167. },
  168. // {
  169. // "type":"html",
  170. // "className":"text-center",
  171. // "html":"<p class='mt-10 text-gray-600'>Roma平台</p>"
  172. // },
  173. ]
  174. }
  175. };
  176. return headerJson;
  177. }