login-json.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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":"html",
  24. "className":"text-center",
  25. "html":"<h1 class='title-name'>Roma 平台</h1>"
  26. },
  27. {
  28. "type": "input-group",
  29. "label": "",
  30. "body": [
  31. {
  32. "type": "icon",
  33. "icon": "./public/static/icon/shield-user-line.svg"
  34. },
  35. {
  36. "type": "input-text",
  37. "label": false,
  38. "placeholder": "用户名",
  39. "name": "name",
  40. "required": true
  41. }
  42. ]
  43. },
  44. {
  45. "type": "input-group",
  46. "label": "",
  47. "body": [
  48. {
  49. "type": "icon",
  50. "icon": "./public/static/icon/lock-password-line.svg",
  51. },
  52. {
  53. "type": "input-password",
  54. "label": false,
  55. "placeholder": "密码",
  56. "name": "pwd",
  57. "required": true
  58. }
  59. ]
  60. },
  61. {
  62. "type": "input-group",
  63. "label": "",
  64. "body": [
  65. {
  66. "type": "icon",
  67. "icon": "./public/static/icon/shield-check-line.svg"
  68. },
  69. {
  70. "type": "input-text",
  71. "label": false,
  72. "placeholder": "验证码",
  73. "name": "code",
  74. "required": true
  75. },
  76. {
  77. "type": "action",
  78. "body": {
  79. "type": "image",
  80. "height": "38px",
  81. "width": "110px",
  82. "name":"codeUrl",
  83. "imageClassName":"code_img b-none",
  84. "imageMode":"original",
  85. "src": "/login/verify"
  86. },
  87. // 点击图片 刷新二维码
  88. "onClick": "refresh_code()"
  89. }
  90. ]
  91. },
  92. {
  93. "label": "登 录",
  94. "type": "action",
  95. "actionType": "submit",
  96. "level": "primary",
  97. "className":"w-full h-2.5",
  98. },
  99. {
  100. "type": "wrapper",
  101. "body": [
  102. {
  103. "type": "flex",
  104. "id": "u:e7752d0c1dbe",
  105. "justify": "flex-end",
  106. "items": [
  107. {
  108. "type": "container",
  109. "body": [
  110. {
  111. "type": "tooltip-wrapper",
  112. "tooltip": "请联系管理员,邮箱xxxxx@xxx.com",
  113. "body": [
  114. {
  115. "type": "tpl",
  116. "tpl": "忘记密码?",
  117. "id": "u:47f172268df5",
  118. "wrapperComponent": "",
  119. "hidden": false,
  120. "className": "m-l-none"
  121. }
  122. ],
  123. "enterable": true,
  124. "showArrow": true,
  125. "offset": [
  126. 8,
  127. 6
  128. ],
  129. "id": "u:3878dcf435b8",
  130. "trigger": [
  131. "hover"
  132. ],
  133. "mouseEnterDelay": 0,
  134. "mouseLeaveDelay": 0,
  135. "placement": "bottom",
  136. "inline": true
  137. }
  138. ],
  139. "size": "xs",
  140. "style": {
  141. "position": "static",
  142. "display": "block",
  143. "flex": "1 1 auto",
  144. "flexGrow": 1,
  145. "flexBasis": "auto"
  146. },
  147. "wrapperBody": false,
  148. "isFixedHeight": false,
  149. "isFixedWidth": false,
  150. "id": "u:ec685674b43d"
  151. },
  152. {
  153. "type": "dropdown-button",
  154. "label": "",
  155. "className": "header-menu",
  156. "buttons": [
  157. {
  158. "type": "button",
  159. "label": "中文",
  160. "id": "u:6911502c8fcc",
  161. "onEvent": {
  162. "click": {
  163. "actions": [
  164. {
  165. "script": "localStorage.setItem('language', 'zh-CN')\nlocation.reload()",
  166. "actionType": "custom",
  167. "args": {
  168. }
  169. }
  170. ],
  171. "weight": 0
  172. }
  173. }
  174. },
  175. {
  176. "type": "button",
  177. "label": "English",
  178. "id": "u:e702685a7a45",
  179. "onEvent": {
  180. "click": {
  181. "actions": [
  182. {
  183. "script": "localStorage.setItem('language', 'en-US')\r\nlocation.reload()",
  184. "actionType": "custom"
  185. }
  186. ],
  187. "weight": 0
  188. }
  189. },
  190. "actionType": "",
  191. "link": "/view/user_info"
  192. }
  193. ],
  194. "id": "u:4fedf7a987bf",
  195. "size": "md",
  196. "level": "default",
  197. "align": "right",
  198. "block": false,
  199. "hideCaret": true,
  200. "trigger": "hover",
  201. "icon": "./public/static/icon/language-change.png",
  202. "btnClassName": "no-border"
  203. }
  204. ]
  205. }
  206. ],
  207. "id": "u:d16525b6aae6",
  208. "asideResizor": false,
  209. "pullRefresh": {
  210. "disabled": true
  211. }
  212. },
  213. {
  214. "type": "divider",
  215. "id": "u:4ba78892d2e9"
  216. },
  217. {
  218. "type":"html",
  219. "className":"text-center",
  220. "html":"<p class='mt-10 text-gray-600'>© 2023, Roma Services LLC. All Rights Reserved. An Roma Company</p>"
  221. }
  222. ]
  223. }
  224. };
  225. return headerJson;
  226. }