| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="UTF-8" />
- <title>登录</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="icon" type="image/x-ico" href=""/>
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
- <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
- <link rel="stylesheet" href="./public/static/amis-sdk/helper.css">
- <link rel="stylesheet" href="./public/static/amis-sdk/sdk.css">
- <style>
- html,
- body,
- .app-wrapper {
- /* position: relative; */
- width: 100%;
- height: 100%;
- margin: 0;
- padding: 0;
- touch-action: pan-y;
- overflow: hidden;
- }
- :root {
- --Form-item-gap: 1.3rem;
- --InputGroup-height: 2.5rem;
- --Button-height: 2.5rem;
- --InputGroup-paddingX: .6rem;
- --InputGroup-addOn-bg: var(--Form-input-bg);
- /* --fontSizeBase: .9rem; */
- }
- .app-wrapper {
- /* position: relative; */
- width: 100%;
- height: 100%;
- margin: 0;
- padding: 0;
- }
- .amis-scope .cxd-Icon{height: 1rem}
- .amis-scope .cxd-TextControl-input input{height: 100% !important;}
- .amis-scope .cxd-TextControl-input:hover{border:var(--Form-input-borderWidth) solid var(--Form-input-borderColor)}
- .amis-scope .cxd-InputGroup .cxd-TextControl-input{border-left-width: 0;padding-left: 0;}
- .code_img{cursor: pointer;}
- .amis-scope .cxd-Form{
- font-size: var(--Form-fontSize);
- position: none !important;
- max-width: 700px;
- margin: 0 auto;
- margin-top: 10vh;
- /* position:; */
- }
- .amis-scope .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
- width: 100%;
- height: 100%;
- }
- .change-language {
- float: right;
- }
- .amis-scope h1 {
- font-size: 5vw;
- }
- @media (max-width: 768px) {
- .amis-scope .cxd-Form{
- font-size: var(--Form-fontSize);
- position: none !important;
- margin: 0 auto;
- margin-top: 0vh;
- /* position:; */
- }
- .amis-scope .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
- padding: 0;
- }
- }
- </style>
- </head>
- <body>
- <div id="root" class="app-wrapper"></div>
- <script type='text/javascript' src='./public/static/amis-sdk/sdk.js'></script>
- <script type="text/javascript">
- (function () {
- let amis = amisRequire('amis/embed');
- const amisJSON = {
- "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":"/login",
- "adaptor": function (data) {
- if (data.status !== 0) {
- // 登录请求提交后,刷新验证码
- refresh_code();
- }
- return data;
- },
- },
- "redirect": "/",
- "wrapWithPanel": false,
- "body": [
- {
- "type":"html",
- "className":"text-center",
- "html":"<img class='change-language' src='./public/static/icon/shield-user-line.svg'/>"
- },
- {
- "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": "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": "pwd",
- "required": true
- }
- ]
- },
- {
- "type": "input-group",
- "label": "",
- "body": [
- {
- "type": "icon",
- "icon": "./public/static/icon/shield-check-line.svg"
- },
- {
- "type": "input-text",
- "label": false,
- "placeholder": "验证码",
- "name": "code",
- "required": true
- },
- {
- "type": "action",
- "body": {
- "type": "image",
- "height": "38px",
- "width": "110px",
- "name":"codeUrl",
- "imageClassName":"code_img b-none",
- "imageMode":"original",
- "src": "/login/verify"
- },
- // 点击图片 刷新二维码
- "onClick": "refresh_code()"
- }
- ]
- },
- {
- "label": "登 录",
- "type": "action",
- "actionType": "submit",
- "level": "primary",
- "className":"w-full h-2.5",
- },
- // {
- // "type":"html",
- // "className":"text-center",
- // "html":"<p class='mt-10 text-gray-600'>Roma平台</p>"
- // },
- ]
- }
- };
- let amisScoped = amis.embed('#root', amisJSON);
- })();
- // 刷新验证码
- function refresh_code()
- {
- document.querySelector('.code_img').src = '/login/verify?' + Math.random();
- }
- </script>
- </body>
- </html>
|