| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- function getLoginJson() {
- let headerJson = {
- "type": "wrapper",
- "className": "fixed login_layout m:h-screen m:w-full bg-gray-50",
- "body": {
- "type": "form",
- "className": "h-full pc:p-9 m:p-4 m:pt-20",
- "api": {
- "method":"post",
- "url":"/api/login",
- "dataType":"form",
- "headers": {
- "Authorization": 'Bearer ' + getToken()
- },
- "requestAdaptor":function(data){
- data.data.captchaToken = getCaptchaCode()
-
- return data;
- },
- "adaptor": function (data, response) {
- // token 续期的问题,在app.html中进行续期判断.
- if (data.status != "0") {
- // 登录请求提交后,刷新验证码
- refresh_code();
- // 弹出错误提示
- } else {
- // 存储登录token
- let token = data.data.loginToken;
- localStorage.setItem("apiToken", token);
- }
- return {
- ...data,
- status: data.status,
- msg: data.status == "0" ? "" : data.msg,
- };
- },
- "messages": {
- "success": "success",
- // "failed": "糟糕,失败了!"
- }
- },
- "redirect": "./app.html",
- "wrapWithPanel": false,
- "body": [
- {
- "type":"html",
- "className":"text-center",
- "html":"<h1 class='title-name'>Roma 平台</h1>"
- },
- {
- "type": "input-group",
- "label": "",
- "body": [
- {
- "type": "icon",
- "icon": "./public/static/icon/shield-user-line.svg"
- },
- {
- "type": "input-text",
- "label": false,
- "placeholder": "用户名",
- "name": "api_name",
- "required": true
- }
- ]
- },
- {
- "type": "input-group",
- "label": "",
- "body": [
- {
- "type": "icon",
- "icon": "./public/static/icon/lock-password-line.svg",
- },
- {
- "type": "input-password",
- "label": false,
- "placeholder": "密码",
- "name": "api_password",
- "required": true
- }
- ]
- },
- {
- "type": "input-group",
- "label": "",
- "body": [
- {
- "type": "icon",
- "icon": "./public/static/icon/shield-check-line.svg"
- },
- {
- "type": "input-text",
- "label": false,
- "placeholder": "验证码",
- "name": "api_captcha",
- "required": true
- },
- {
- "type": "action",
- "body": {
- "type": "image",
- "height": "38px",
- "width": "110px",
- "name":"codeUrl",
- "imageClassName":"code_img b-none",
- "imageMode":"original",
- "src": ""
- },
- // 点击图片 刷新二维码
- "onClick": "refresh_code()"
- }
- ]
- },
- {
- "type": "hidden",
- "name": "captchaToken",
- "value": ""
- },
- {
- "label": "登 录",
- "type": "action",
- "actionType": "submit",
- "level": "primary",
- "className":"w-full h-2.5",
- },
- {
- "type": "wrapper",
- "body": [
- {
- "type": "flex",
- "id": "u:e7752d0c1dbe",
- "justify": "flex-end",
- "items": [
- {
- "type": "container",
- "body": [
- {
- "type": "tooltip-wrapper",
- "tooltip": "请联系管理员,邮箱xxxxx@xxx.com",
- "body": [
- {
- "type": "tpl",
- "tpl": "忘记密码?",
- "id": "u:47f172268df5",
- "wrapperComponent": "",
- "hidden": false,
- "className": "m-l-none"
- }
- ],
- "enterable": true,
- "showArrow": true,
- "offset": [
- 8,
- 6
- ],
- "id": "u:3878dcf435b8",
- "trigger": [
- "hover"
- ],
- "mouseEnterDelay": 0,
- "mouseLeaveDelay": 0,
- "placement": "bottom",
- "inline": true
- }
- ],
- "size": "xs",
- "style": {
- "position": "static",
- "display": "block",
- "flex": "1 1 auto",
- "flexGrow": 1,
- "flexBasis": "auto"
- },
- "wrapperBody": false,
- "isFixedHeight": false,
- "isFixedWidth": false,
- "id": "u:ec685674b43d"
- },
- {
- "type": "dropdown-button",
- "label": "",
- "className": "header-menu",
- "buttons": [
- {
- "type": "button",
- "label": "中文",
- "id": "u:6911502c8fcc",
- "onEvent": {
- "click": {
- "actions": [
- {
- "script": "localStorage.setItem('language', 'zh-CN')\nlocation.reload()",
- "actionType": "custom",
- "args": {
- }
- }
- ],
- "weight": 0
- }
- }
- },
- {
- "type": "button",
- "label": "English",
- "id": "u:e702685a7a45",
- "onEvent": {
- "click": {
- "actions": [
- {
- "script": "localStorage.setItem('language', 'en-US')\r\nlocation.reload()",
- "actionType": "custom"
- }
- ],
- "weight": 0
- }
- },
- "actionType": "",
- "link": "/view/user_info"
- }
- ],
- "id": "u:4fedf7a987bf",
- "size": "md",
- "level": "default",
- "align": "right",
- "block": false,
- "hideCaret": true,
- "trigger": "hover",
- "icon": "./public/static/icon/language-change.png",
- "btnClassName": "no-border"
- }
- ]
- }
- ],
- "id": "u:d16525b6aae6",
- "asideResizor": false,
- "pullRefresh": {
- "disabled": true
- }
- },
- {
- "type": "divider",
- "id": "u:4ba78892d2e9"
- },
- {
- "type":"html",
- "className":"text-center",
- "html":"<p class='mt-10 text-gray-600'>© 2023, Roma Services LLC. All Rights Reserved. An Roma Company</p>"
- }
- ]
- }
- };
- return headerJson;
- }
|