ソースを参照

Merge remote-tracking branch 'origin/dev' into dev

梁世豪 2 ヶ月 前
コミット
c3e67a6de9

File diff suppressed because it is too large
+ 3 - 2
src/main/resources/static/css/themes/default.css


BIN
src/main/resources/static/images/logo.ico


+ 1 - 1
src/main/resources/templates/home/index.html

@@ -11,7 +11,7 @@
11 11
     <meta name="apple-mobile-web-app-status-bar-style" content="black">
12 12
     <meta name="apple-mobile-web-app-capable" content="yes">
13 13
     <meta name="format-detection" content="telephone=no">
14
-    <link rel="icon" th:href="@{/images/favicon.ico}">
14
+    <link rel="icon" th:href="@{/images/logo.ico}">
15 15
     <link rel="stylesheet" th:href="@{/lib/layui-v2.6.3/css/layui.css}" media="all">
16 16
     <link rel="stylesheet" th:href="@{/css/layuimini.css}" media="all">
17 17
     <link rel="stylesheet" th:href="@{/css/themes/default.css}" media="all">

+ 220 - 0
src/main/resources/templates/login/login-1.html

@@ -0,0 +1,220 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <title>后台管理-登陆</title>
6
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7
+    <meta http-equiv="Access-Control-Allow-Origin" content="*">
8
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
9
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
10
+    <meta name="apple-mobile-web-app-capable" content="yes">
11
+    <meta name="format-detection" content="telephone=no">
12
+    <link rel="stylesheet" th:href="@{/lib/layui-v2.6.3/css/layui.css}" media="all">
13
+    <!--[if lt IE 9]>
14
+    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
15
+    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
16
+    <![endif]-->
17
+    <style>
18
+        html, body {width: 100%;height: 100%;overflow: hidden}
19
+        body {
20
+        /*    background: #1E9FFF;*/
21
+            background-image: url('./static/images/logo.png');
22
+            /* 让背景图片覆盖整个背景区域 */
23
+            background-size: cover;
24
+            /* 防止背景图片重复 */
25
+            background-repeat: no-repeat;
26
+            /* 将背景图片居中显示 */
27
+            background-position: center;
28
+        }
29
+        body:after {
30
+            content:'';
31
+            background-repeat:no-repeat;
32
+            background-size:cover;
33
+            -webkit-filter:blur(3px);
34
+            -moz-filter:blur(3px);
35
+            -o-filter:blur(3px);
36
+            -ms-filter:blur(3px);
37
+            filter:blur(3px);
38
+            position:absolute;
39
+            top:0;
40
+            left:0;
41
+            right:0;
42
+            bottom:0;
43
+            z-index:-1;
44
+        }
45
+        .layui-container {width: 100%;height: 100%;overflow: hidden}
46
+        .admin-login-background {width:360px;height:300px;position:absolute;left:50%;top:40%;margin-left:-180px;margin-top:-100px;}
47
+        .logo-title {text-align:center;letter-spacing:2px;padding:14px 0;}
48
+        .logo-title h1 {color:#ecf0f1;font-size:25px;font-weight:bold;}
49
+        .login-form {background-color:#2c3e50;border:1px solid #2980b9;border-radius:3px;padding:14px 20px;box-shadow:0 0 8px #eeeeee;}
50
+        .login-form .layui-form-item {position:relative;}
51
+        .login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;
52
+            color:#2980b9;}
53
+        .login-form .layui-form-item input {padding-left:36px;}
54
+        .captcha {width:60%;display:inline-block;}
55
+        .captcha-img {display:inline-block;width:34%;float:right;}
56
+        .captcha-img img {height:34px;border:1px solid #2980b9;height:36px;width:100%;}
57
+    </style>
58
+</head>
59
+<body>
60
+<div class="layui-container">
61
+    <div class="admin-login-background">
62
+        <div class="layui-form login-form">
63
+            <form class="layui-form" action="">
64
+                <div class="layui-form-item logo-title">
65
+                    <h1>问题单管理系统</h1>
66
+                </div>
67
+                <div class="layui-form-item">
68
+                    <label class="layui-icon layui-icon-username" for="username"></label>
69
+                    <input type="text" name="username" lay-verify="required|account" placeholder="用户名或者邮箱" autocomplete="off" class="layui-input" value="admin">
70
+                </div>
71
+                <div class="layui-form-item">
72
+                    <label class="layui-icon layui-icon-password" for="password"></label>
73
+                    <input type="password" name="password" lay-verify="required|password" placeholder="密码" autocomplete="off" class="layui-input" value="123456">
74
+                </div>
75
+                <div class="layui-form-item">
76
+                    <label class="layui-icon layui-icon-vercode" for="captcha"></label>
77
+                    <input type="text" name="captcha" lay-verify="required|captcha" placeholder="图形验证码" autocomplete="off" class="layui-input verification captcha" value="xszg">
78
+                    <div class="captcha-img">
79
+                        <img id="captchaPic" src="../images/captcha.jpg">
80
+                    </div>
81
+                </div>
82
+                <div class="layui-form-item">
83
+                    <input type="checkbox" name="rememberMe" value="true" lay-skin="primary" title="记住密码">
84
+                </div>
85
+                <div class="layui-form-item">
86
+                    <button class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" lay-submit="" lay-filter="login">登 入</button>
87
+                </div>
88
+            </form>
89
+        </div>
90
+    </div>
91
+</div>
92
+
93
+<script th:src="@{/lib/jq-module/jquery.particleground.min.js}" charset="utf-8"></script>
94
+<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
95
+<script th:src="@{/lib/layui-v2.6.3/layui.js}" charset="utf-8"></script>
96
+<script th:src="@{/lib/md5/md5.min.js}" charset="utf-8"></script>
97
+<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
98
+<script>
99
+    layui.use(['form'], function () {
100
+        var form = layui.form,
101
+            layer = layui.layer;
102
+
103
+        // 登录过期的时候,跳出ifram框架
104
+        if (top.location != self.location) top.location = self.location;
105
+
106
+        // 粒子线条背景
107
+        $(document).ready(function(){
108
+            $('.layui-container').particleground({
109
+                dotColor:'#7ec7fd',
110
+                lineColor:'#7ec7fd'
111
+            });
112
+        });
113
+
114
+        // 进行登录操作
115
+        form.on('submit(login)', function (data) {
116
+            data = data.field;
117
+            if (data.username == '') {
118
+                layer.msg('用户名不能为空');
119
+                return false;
120
+            }
121
+            if (data.password == '') {
122
+                layer.msg('密码不能为空');
123
+                return false;
124
+            }
125
+/*            if (data.captcha == '') {
126
+                layer.msg('验证码不能为空');
127
+                return false;
128
+            }*/
129
+            if ($('.icon-nocheck').hasClass('icon-check')) {
130
+                localStorage.setItem("username", formdata.username, "7d");
131
+                localStorage.setItem("password", formdata.password, "7d");
132
+                // localStorage.setItem("wowosign", "rememberMe", "7d");
133
+            } else {
134
+                localStorage.removeItem("username");
135
+                localStorage.removeItem("password");
136
+                // localStorage.removeItem("wowosign");
137
+            }
138
+            // 添加一个条件判断
139
+            let password = md5.MD5(formdata.password); // 加密输入的密码
140
+            // 设置按钮为登陆中,此时禁止点击
141
+            logining();
142
+
143
+            AjaxUtil.post({
144
+                contentType: "application/x-www-form-urlencoded", // 默认就是这个
145
+                url: AjaxUtil.ctx + "home/doLogin",
146
+                data: {
147
+                    "username": formdata.username,
148
+                    "password": password
149
+                },
150
+                success: function (res) {
151
+                    console.log(res);
152
+
153
+                    if (res.code === 0) {
154
+                        layNotify.notice({
155
+                            title: "登录提示",
156
+                            type: "success",
157
+                            message: res.message
158
+                        });
159
+                        setTimeout(function () {
160
+                            window.location.href = AjaxUtil.ctx + "home/index";
161
+                        }, 1500);
162
+                    } else {
163
+                        loginend();
164
+                        layNotify.notice({
165
+                            title: "登录提示",
166
+                            type: "warning",
167
+                            message: res.message
168
+                        });
169
+                        // document.getElementById("ver_btn").click();
170
+                        // 验证码刷新
171
+                        /* document.getElementById("captcha").value = '';*/
172
+                        document.getElementById("password").value = '';
173
+                        console.log(res.message);
174
+                        // 阻止后续操作
175
+                    }
176
+                },
177
+                error: function (error) {
178
+                    loginend();
179
+                    redirection();
180
+                    layNotify.notice({
181
+                        title: "登录提示",
182
+                        type: "error",
183
+                        message: "请求失败,请联系系统管理员!"
184
+                    });
185
+
186
+                }
187
+            });
188
+
189
+            return false; //阻止表单跳转,layui默认是form提交,阻止掉
190
+
191
+            layer.msg('登录成功',{icon:1}, function () {
192
+                window.location = '../index.html';
193
+            });
194
+            return false;
195
+        });
196
+
197
+
198
+        function redirection() {
199
+            window.location.replace("http://10.208.114.107:8081/home/index")
200
+        }
201
+
202
+        // 登陆中
203
+        function logining() {
204
+            document.getElementById("btn_login").setAttribute("disabled", true);//设置不可点击
205
+            document.getElementById("btn_login").style.backgroundColor = '#9abcda';
206
+            document.getElementById("btn_msg").innerText = '登 录 中';
207
+            document.getElementById("btn_load").style.display = "inline-block";
208
+        }
209
+
210
+        // 登陆后
211
+        function loginend() {
212
+            document.getElementById("btn_login").removeAttribute("disabled");//去掉不可点击
213
+            document.getElementById("btn_login").style.backgroundColor = '#1E9FFF';
214
+            document.getElementById("btn_msg").innerText = '登 录';
215
+            document.getElementById("btn_load").style.display = "none";
216
+        }
217
+    });
218
+</script>
219
+</body>
220
+</html>

+ 1 - 2
src/main/resources/templates/login/login.html

@@ -9,9 +9,8 @@
9 9
     <meta name="apple-mobile-web-app-status-bar-style" content="black">
10 10
     <meta name="apple-mobile-web-app-capable" content="yes">
11 11
     <meta name="format-detection" content="telephone=no">
12
-    <link rel="icon" th:href="@{//images/favicon.ico}">
12
+    <link rel="icon" th:href="@{//images/logo.ico}">
13 13
     <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
14
-
15 14
     <style th:inline="text">
16 15
         .main-body {
17 16
             top: 50%;