|
@@ -0,0 +1,219 @@
|
|
1
|
+<!DOCTYPE html>
|
|
2
|
+<html lang="en">
|
|
3
|
+<head>
|
|
4
|
+ <meta charset="UTF-8">
|
|
5
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+ <link rel="stylesheet" href="styles.css">
|
|
7
|
+ <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
|
|
8
|
+ <link rel="icon" th:href="@{//images/logo.ico}">
|
|
9
|
+ <title>Account Login</title>
|
|
10
|
+ <style>
|
|
11
|
+ * {
|
|
12
|
+ margin: 0;
|
|
13
|
+ padding: 0;
|
|
14
|
+ box-sizing: border-box;
|
|
15
|
+ font-family: 'Poppins', sans-serif;
|
|
16
|
+ }
|
|
17
|
+
|
|
18
|
+ body {
|
|
19
|
+ display: flex;
|
|
20
|
+ justify-content: center;
|
|
21
|
+ align-items: center;
|
|
22
|
+ min-height: 100vh;
|
|
23
|
+ /* 以下是背景图片相关设置 */
|
|
24
|
+ /*background-image: url('/images/loginbg.png');*/
|
|
25
|
+/* background-color: #0c0f13;*/
|
|
26
|
+ background-image: url("/images/logo-v1.png");
|
|
27
|
+ background-size: cover;
|
|
28
|
+ background-position: center;
|
|
29
|
+ background-repeat: no-repeat;
|
|
30
|
+ width: 100%;
|
|
31
|
+ overflow: hidden;
|
|
32
|
+ }
|
|
33
|
+ .container {
|
|
34
|
+ position: relative;
|
|
35
|
+ min-height: 100vh;
|
|
36
|
+ width: 100%;
|
|
37
|
+ background: rgba(255, 255, 255, 0.2); /* 设置半透明白色背景,使内容更易读 */
|
|
38
|
+
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ .logo {
|
|
42
|
+ position: absolute;
|
|
43
|
+ top: 50px;
|
|
44
|
+ left: 50px;
|
|
45
|
+ display: flex;
|
|
46
|
+ align-items: center;
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ .logo img {
|
|
50
|
+ width: 32px;
|
|
51
|
+ height: 32px;
|
|
52
|
+ margin-right: 10px;
|
|
53
|
+ }
|
|
54
|
+
|
|
55
|
+ .logo h2 {
|
|
56
|
+ font-size: 24px;
|
|
57
|
+ font-weight: 700;
|
|
58
|
+ color: #333;
|
|
59
|
+ }
|
|
60
|
+
|
|
61
|
+ .login-box {
|
|
62
|
+ position: absolute;
|
|
63
|
+ top: 50%;
|
|
64
|
+ left: 50%;
|
|
65
|
+ transform: translate(-50%, -50%);
|
|
66
|
+ width: 350px;
|
|
67
|
+ padding: 40px;
|
|
68
|
+ background: #fff;
|
|
69
|
+ border-radius: 20px;
|
|
70
|
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
|
|
71
|
+ text-align: center;
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ .avatar {
|
|
75
|
+ width: 100px;
|
|
76
|
+ height: 100px;
|
|
77
|
+ border-radius: 50%;
|
|
78
|
+ overflow: hidden;
|
|
79
|
+ margin: 0 auto 20px;
|
|
80
|
+ }
|
|
81
|
+
|
|
82
|
+ .avatar img {
|
|
83
|
+ width: 100%;
|
|
84
|
+ height: 100%;
|
|
85
|
+ object-fit: cover;
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ .login-box h2 {
|
|
89
|
+ font-size: 23px;
|
|
90
|
+ font-weight: 700;
|
|
91
|
+ color: #2980b9;
|
|
92
|
+ margin-bottom: 20px;
|
|
93
|
+ }
|
|
94
|
+
|
|
95
|
+ .input-box {
|
|
96
|
+ position: relative;
|
|
97
|
+ width: 100%;
|
|
98
|
+ margin-bottom: 20px;
|
|
99
|
+ }
|
|
100
|
+
|
|
101
|
+ .input-box input {
|
|
102
|
+ width: 100%;
|
|
103
|
+ padding: 10px;
|
|
104
|
+ border: 1px solid #ccc;
|
|
105
|
+ border-radius: 10px;
|
|
106
|
+ outline: none;
|
|
107
|
+ font-size: 16px;
|
|
108
|
+ }
|
|
109
|
+
|
|
110
|
+ .input-box i {
|
|
111
|
+ position: absolute;
|
|
112
|
+ top: 50%;
|
|
113
|
+ right: 10px;
|
|
114
|
+ transform: translateY(-50%);
|
|
115
|
+ font-size: 18px;
|
|
116
|
+ color: #ccc;
|
|
117
|
+ }
|
|
118
|
+
|
|
119
|
+ .login-btn {
|
|
120
|
+ width: 100%;
|
|
121
|
+ padding: 10px;
|
|
122
|
+ background: #007bff;
|
|
123
|
+ color: #fff;
|
|
124
|
+ border: none;
|
|
125
|
+ border-radius: 10px;
|
|
126
|
+ font-size: 16px;
|
|
127
|
+ cursor: pointer;
|
|
128
|
+ }
|
|
129
|
+
|
|
130
|
+ .login-box p {
|
|
131
|
+ margin-top: 10px;
|
|
132
|
+ font-size: 14px;
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ .login-box p a {
|
|
136
|
+ color: #007bff;
|
|
137
|
+ text-decoration: none;
|
|
138
|
+ }
|
|
139
|
+ .container .input-box .icon-2{
|
|
140
|
+ background: url("/images/icon-login.png") no-repeat -54px 0;
|
|
141
|
+ }
|
|
142
|
+ </style>
|
|
143
|
+</head>
|
|
144
|
+
|
|
145
|
+<body>
|
|
146
|
+<div class="container">
|
|
147
|
+ <div class="logo">
|
|
148
|
+ <img src="/images/logo.png" alt="User Icon">
|
|
149
|
+ <h2>科研管控平台</h2>
|
|
150
|
+ </div>
|
|
151
|
+ <div class="login-box">
|
|
152
|
+ <div class="avatar">
|
|
153
|
+ <img src="/images/logo.png" alt="Avatar">
|
|
154
|
+ </div>
|
|
155
|
+ <h2>Welcome back</h2>
|
|
156
|
+ <form class="layui-form">
|
|
157
|
+ <div class="input-box">
|
|
158
|
+ <span class="icon icon-2"></span>
|
|
159
|
+ <input type="text" name="username" id="username" lay-verify="required" placeholder="账户名" maxlength="24" autocomplete="current-password"/>
|
|
160
|
+ <i class="fas fa-user"></i>
|
|
161
|
+ </div>
|
|
162
|
+ <div class="input-box">
|
|
163
|
+ <span class="icon icon-2"></span>
|
|
164
|
+ <input type="password" placeholder="密码" id="password" name="password" lay-verify="required" maxlength="18" autocomplete="current-password">
|
|
165
|
+ <i class="fas fa-lock"></i>
|
|
166
|
+ </div>
|
|
167
|
+ <button type="submit" class="login-btn" id="logn">登录</button>
|
|
168
|
+ <!-- <p>Don't have an account? <a href="#">signup</a></p>-->
|
|
169
|
+ </form>
|
|
170
|
+ </div>
|
|
171
|
+</div>
|
|
172
|
+<script>
|
|
173
|
+ const inputs = [
|
|
174
|
+ document.getElementById('username'),
|
|
175
|
+ document.getElementById('password')
|
|
176
|
+ ]
|
|
177
|
+
|
|
178
|
+ inputs.forEach(input =>{
|
|
179
|
+ input.addEventListener('input',function () {
|
|
180
|
+ this.value = this.value.replace(/\s+/g,'');
|
|
181
|
+ })
|
|
182
|
+ })
|
|
183
|
+</script>
|
|
184
|
+<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
|
|
185
|
+<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
|
|
186
|
+<script th:src="@{/lib/md5/md5.min.js}" charset="utf-8"></script>
|
|
187
|
+<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
|
|
188
|
+<script>
|
|
189
|
+ AjaxUtil.ctx = /*[[@{/}]]*/'';
|
|
190
|
+ // 在页面加载完毕后调用拦截器函数
|
|
191
|
+ layui.use(['form','layNotify','layer'],function () {
|
|
192
|
+ var form = layer.form,
|
|
193
|
+ layNotify = layui.layNotify;
|
|
194
|
+ layer = layui.layer;
|
|
195
|
+
|
|
196
|
+ const logn = document.getElementById('logn');
|
|
197
|
+ const username = document.getElementById('username');
|
|
198
|
+ const password = document.getElementById('password');
|
|
199
|
+ // 登录
|
|
200
|
+ logn.addEventListener('click',function () {
|
|
201
|
+ console.log('我登录了');
|
|
202
|
+ if (username.value != null){
|
|
203
|
+ layer.msg('用户名不能为空!',{icon:2},function () {
|
|
204
|
+
|
|
205
|
+ });
|
|
206
|
+ }
|
|
207
|
+ if (password.value != null){
|
|
208
|
+ layer.msg('密码不能为空!',{icon:2},function () {
|
|
209
|
+
|
|
210
|
+ })
|
|
211
|
+ }
|
|
212
|
+
|
|
213
|
+ });
|
|
214
|
+
|
|
215
|
+ })
|
|
216
|
+
|
|
217
|
+</script>
|
|
218
|
+</body>
|
|
219
|
+</html>
|