懒羊羊
2023-11-14 8286c62256f23bc2367a6729c0f46f84215e380b
提交 | 用户 | 时间
8286c6 1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script>if (window !== top) top.location.replace(location.href);</script>
5     <meta charset="utf-8"/>
6     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
8     <link href="${ctxPath}/assets/expand/images/favicon.ico" rel="icon">
9     <title>登录</title>
10     <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
11     <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}"/>
12     <!--[if lt IE 9]>
13     <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
14     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
15     <![endif]-->
16     <style>
17         body {
18             background-image: url("${ctxPath}/assets/common/images/bg-login.jpg");
19             background-repeat: no-repeat;
20             background-size: cover;
21             min-height: 100vh;
22         }
23
24         body:before {
25             content: "";
26             background-color: rgba(0, 0, 0, .2);
27             position: fixed;
28             top: 0;
29             left: 0;
30             right: 0;
31             bottom: 0;
32         }
33
34         .login-wrapper {
35             max-width: 420px;
36             padding: 20px;
37             margin: 0 auto;
38             position: relative;
39             box-sizing: border-box;
40             z-index: 2;
41         }
42
43         .login-wrapper > .layui-form {
44             padding: 25px 30px;
45             background-color: #fff;
46             box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.19);
47             box-sizing: border-box;
48             border-radius: 4px;
49         }
50
51         .login-wrapper > .layui-form > h2 {
52             color: #333;
53             font-size: 18px;
54             text-align: center;
55             margin-bottom: 25px;
56         }
57
58         .login-wrapper > .layui-form > .layui-form-item {
59             margin-bottom: 25px;
60             position: relative;
61         }
62
63         .login-wrapper > .layui-form > .layui-form-item:last-child {
64             margin-bottom: 0;
65         }
66
67         .login-wrapper > .layui-form > .layui-form-item > .layui-input {
68             height: 46px;
69             line-height: 46px;
70             border-radius: 2px !important;
71         }
72
73         .login-wrapper .layui-input-icon-group > .layui-input {
74             padding-left: 46px;
75         }
76
77         .login-wrapper .layui-input-icon-group > .layui-icon {
78             width: 46px;
79             height: 46px;
80             line-height: 46px;
81             font-size: 20px;
82             color: #909399;
83             position: absolute;
84             left: 0;
85             top: 0;
86             text-align: center;
87         }
88
89         .login-wrapper > .layui-form > .layui-form-item.login-captcha-group {
90             padding-right: 135px;
91         }
92
93         .login-wrapper > .layui-form > .layui-form-item.login-captcha-group > .login-captcha {
94             height: 46px;
95             width: 120px;
96             cursor: pointer;
97             box-sizing: border-box;
98             border: 1px solid #e6e6e6;
99             border-radius: 2px !important;
100             position: absolute;
101             right: 0;
102             top: 0;
103         }
104
105         .login-wrapper > .layui-form > .layui-form-item > .layui-form-checkbox {
106             margin: 0 !important;
107             padding-left: 25px;
108         }
109
110         .login-wrapper > .layui-form > .layui-form-item > .layui-form-checkbox > .layui-icon {
111             width: 15px !important;
112             height: 15px !important;
113         }
114
115         .login-wrapper > .layui-form .layui-btn-fluid {
116             height: 48px;
117             line-height: 48px;
118             font-size: 16px;
119             border-radius: 2px !important;
120         }
121
122         .login-wrapper > .layui-form > .layui-form-item.login-oauth-group > a > .layui-icon {
123             font-size: 26px;
124         }
125
126         .login-copyright {
127             color: #eee;
128             padding-bottom: 20px;
129             text-align: center;
130             position: relative;
131             z-index: 1;
132         }
133
134         \@media screen and (min-height: 550px) {
135             .login-wrapper {
136                 margin: -250px auto 0;
137                 position: absolute;
138                 top: 50%;
139                 left: 0;
140                 right: 0;
141                 width: 100%;
142             }
143
144             .login-copyright {
145                 position: absolute;
146                 bottom: 0;
147                 right: 0;
148                 left: 0;
149             }
150         }
151
152         .layui-btn {
153             background-color: #5FB878;
154             border-color: #5FB878;
155         }
156
157         .layui-link {
158             color: #5FB878 !important;
159         }
160     </style>
161 </head>
162 <body>
163 <div class="login-wrapper layui-anim layui-anim-scale layui-hide">
164     <div class="layui-form">
165         <h2>科院实验室MES系统</h2>
166         @if(constants.getTenantOpen()){
167         <div class="layui-form-item layui-input-icon-group">
168             <i class="layui-icon layui-icon-username"></i>
169             <select name="tenantCode" id="tenantCode">
170                 <option value="">默认租户</option>
171             </select>
172         </div>
173         @}
174         <div class="layui-form-item layui-input-icon-group">
175             <i class="layui-icon layui-icon-username"></i>
176             <input class="layui-input" id="username" name="username" placeholder="请输入登录账号" value="" autocomplete="off" lay-verType="tips" lay-verify="required" required/>
177         </div>
178         <div class="layui-form-item layui-input-icon-group">
179             <i class="layui-icon layui-icon-password"></i>
180             <input class="layui-input" id="password" name="password" placeholder="请输入登录密码" value="" type="password" lay-verType="tips" lay-verify="required" required/>
181         </div>
182         @if(constants.getKaptchaOpen()){
183         <div class="layui-form-item layui-input-icon-group login-captcha-group">
184             <i class="layui-icon layui-icon-auz"></i>
185             <input class="layui-input" id="kaptcha" placeholder="请输入验证码" autocomplete="off" lay-verType="tips" lay-verify="required" required/>
186             <img class="login-captcha" src="${ctxPath}/kaptcha" alt=""/>
187         </div>
188         @}
189         <!--        <div class="layui-form-item">-->
190         <!--            <input type="checkbox" name="remember" title="记住密码" lay-skin="primary" checked>-->
191         <!--            <a href="javascript:;" class="layui-link pull-right">注册账号</a>-->
192         <!--        </div>-->
193         <div class="layui-form-item">
194             <button class="layui-btn layui-btn-fluid" id="submit">登录</button>
195         </div>
196 <!--        <div class="layui-form-item login-oauth-group text-center">-->
197 <!--            <a href="${ctxPath}/oauth/render/qq"><i class="layui-icon layui-icon-login-qq" style="color:#3492ed;"></i></a>&emsp;-->
198 <!--            <a href="${ctxPath}/oauth/render/gitee">-->
199 <!--                <img class="layui-icon" style="height: 28px;width: 28px; margin-top: -12px !important;" src="${ctxPath}/assets/expand/images/git.png" />-->
200 <!--            </a>-->
201 <!--        </div>-->
202     </div>
203 </div>
204 <!--<div class="login-copyright">copyright © 2020 stylefeng.cn all rights reserved.</div>-->
205
206 @/* 加入contextPath属性和session超时的配置 */
207 <script type="text/javascript">
208     var Feng = {
209         ctxPath: "${ctxPath}",
210         version: '${constants.getReleaseVersion()}'
211     };
212 </script>
213
214 <!-- js部分 -->
215 <script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
216 <script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
217 <script>
218     layui.use(['layer', 'form', 'index', 'ax', 'notice'], function () {
219         var $ = layui.jquery;
220         var layer = layui.layer;
221         var form = layui.form;
222         var $ax = layui.ax;
223         var index = layui.index;
224         var notice = layui.notice;
225
226         $('.login-wrapper').removeClass('layui-hide');
227
228         /* 图形验证码 */
229         $('img.login-captcha').click(function () {
230             this.src = this.src + '?t=' + (new Date).getTime();
231         });
232
233         var errorMsg = "${tips!}";
234         if (errorMsg) {
235             layer.msg(errorMsg, {icon: 5, anim: 6});
236         }
237
238         @if(constants.getTenantOpen()){
239             //初始化租户列表
240             var ajax = new $ax(Feng.ctxPath + "/tenantInfo/listTenants", function (data) {
241                 for (var i = 0; i < data.data.length; i++) {
242                     var name = data.data[i].name;
243                     var code = data.data[i].code;
244                     $("#tenantCode").append('<option value="' + code + '">' + name + '</option>');
245                 }
246                 form.render();
247             }, function (data) {
248             });
249             ajax.start();
250         @}
251
252         //登录操作
253         $('#submit').click(function () {
254             var ajax = new $ax(Feng.ctxPath + "/login", function (data) {
255                 Feng.success("登录成功!");
256                 index.clearTabCache();
257                 window.location.href = Feng.ctxPath + "/";
258             }, function (data) {
259                 layer.msg("登录失败!" + data.responseJSON.message, {icon: 5, anim: 6});
260             });
261             ajax.set("username", $("#username").val());
262             ajax.set("password", $("#password").val());
263             @if(constants.getTenantOpen()){
264                 ajax.set("tenantCode", $("#tenantCode").val());
265             @}
266             @if(constants.getKaptchaOpen()){
267                 ajax.set("kaptcha", $("#kaptcha").val());
268             @}
269             ajax.start();
270         });
271
272     });
273 </script>
274
275
276 </body>
277 </html>