Skip to content

Commit d5e7336

Browse files
committed
2023年5月20日版本更新
1 parent eef0630 commit d5e7336

File tree

14 files changed

+197
-137
lines changed

14 files changed

+197
-137
lines changed

README.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,8 @@
356356
357357

358358
+ **QQ:909088445**
359-
360-
+ 晚上在线,建议先自己寻找问题,实在实现不了,可以滴我
361-
+ 需要定制化项目和修改项目的某些的功能也可以加我
359+
+ 一般晚上在线,建议先自己寻找问题!!!
360+
+ 开源免费, 定制化和调试项目付费。
362361

363362
## 🐼项目API接口文档
364363

@@ -398,16 +397,43 @@
398397

399398
### 2023-5-1
400399

401-
1.添加“系统管理员”权限的系统管理功能,添加借书类型分析统计图(饼图)采用Echarts。
400+
1.添加“系统管理员”权限的系统管理功能,**添加借书类型分析统计图(饼图)**采用Echarts。
401+
402+
2.优化请求在没有收到数据时的显示卡顿的情况,添加“加载中”状态,**使用v-loading**(ElementUI组件库),**优化用户人机交互体验**,在服务器调用接口缓慢的情况下,给予**良好的交互**
403+
404+
3.轮播图优化:**压缩图片体积**,另外使用Swiper的**懒加载**,实现图片加载中状态,然后图片完全加载完成后才显示图片,**优化用户体验过程**
405+
406+
4.后端**新增自定义错误码枚举类**,可以自定义状态码进行返回,保留原有枚举类。
407+
408+
5.前端优化部分表格内容展示,当纵向内容过长,**设置了表格最大高度**,超出就会显示滑动窗口。优化表格列宽度,**提高表格美观度**
409+
410+
6.**添加**书籍管理组件的**批量删除图书**功能,优化管理员体验,不用单个删除图书,**提高效率**
411+
412+
7.Jmeter进行压力测试,服务器接口在**100个用户并发**发送请求的情况下,**QPS达到50**以上。
413+
414+
### 2023-5-20
415+
416+
**后端更新情况**
417+
418+
1.防止前端抓包被获取明文密码,前端输入密码,进行md5加密(混合盐值,防止碰撞),后端直接与数据库加密后的密码比较,相等代表登录成功。提高系统**安全性**
419+
420+
2.整改Controller层,**将业务代码全部放入Service层**,由Controller调用Service服务,并修改了@Transactional注解位置到业务层,减少耦合度,让Controller减少臃肿。做到对扩展开放,对修改关闭。后续考虑运用**设计模式**进行优化代码和**多线程**知识提高在**高并发**下接口响应的速度。
421+
422+
3.对照阿里巴巴手册进行代码修改,将警告进行减少,代码更加**优雅、规范**
423+
424+
4.**修复BUG**: 借阅时间为空,造成服务器被击穿。归还日期为空,仍然显示借书成功。(解决方法:时间参数进行校验,判断是否为空)
425+
426+
5.**工具类增加情况**:SQLUtils(防止SQL注入),NetUtils(网络工具类)
427+
428+
**前端更新情况**
402429

403-
2.优化请求在没有收到数据时的显示卡顿的情况,添加“加载中”状态,使用v-loading(ElementUI组件库),优化用户人机交互体验,在服务器调用接口缓慢的情况下,给予良好的交互
430+
1.将路由加载方式,改为懒加载,利用懒加载可以有效分担首页加载压力,**减少首页加载用时**
404431

405-
3.轮播图优化:压缩图片体积,另外使用Swiper的懒加载,实现图片加载中状态,然后图片完全加载完成后才显示图片,优化用户体验过程
432+
2.添加404页面,当用户访问请求地址不存在的页面,直接跳转到404页面,**提高用户体验度**
406433

407-
4.后端新增自定义错误码枚举类,可以自定义状态码进行返回,保留原有枚举类
434+
3.添加按钮的加载中状态,**优化人机交互**,提升用户体验度。修改按钮:登录按钮,其他按钮如果有需要可以自定义去修改,增加:loading="loading"即可
408435

409-
5.前端优化部分表格内容展示,当纵向内容过长,设置了表格最大高度,超出就会显示滑动窗口。优化表格列宽度,提高表格美观度。
436+
**Bug修复情况**
410437

411-
6.添加书籍管理组件的批量删除图书功能,优化管理员体验,不用单个删除图书,提高效率
438+
1.11位图书编号可以借,但却**无法进行逾期检查**,发现方法参数还是Integer,上次把借书和还书的改成Long了,逾期查看还没改成Long,因此出现问题,现在已经修复
412439

413-
7.Jmeter进行压力测试,服务器接口在100个用户并发发送请求的情况下,QPS达到50以上。

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
8-
"dev": "npm run serve"
8+
"dev": "npm run serve",
9+
"npm-build": "npm run build"
910
},
1011
"dependencies": {
1112
"axios": "^1.2.1",

public/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
1010
<!-- <link rel="stylesheet" href="../node_modules/swiper/dist/css/swiper.min.css">
1111
<script src="../node_modules/swiper/dist/js/swiper.min.js"></script> -->
12-
12+
<!-- md5加密工具类cdn -->
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
14+
1315
<title>图书管理系统</title>
1416

1517
</head>

src/assets/images/404.png

22.9 KB
Loading

src/components/404/404.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<div class="container">
3+
4+
</div>
5+
</template>
6+
7+
<script>
8+
</script>
9+
<style>
10+
.container {
11+
width: 100%;
12+
height: 100vh;
13+
background: url('@/assets/images/404.png') no-repeat;
14+
background-size: cover;
15+
}
16+
</style>

src/components/Admin/LoginAdmin.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</el-form-item>
3434
<!-- 按钮区域 -->
3535
<el-form-item class="btns">
36-
<el-button type="primary" @click="login">登录</el-button>
36+
<el-button type="primary" @click="login" :loading="loginLoading">登录</el-button>
3737
<el-button type="info" @click="resetLoginForm">重置</el-button>
3838
</el-form-item>
3939
</el-form>
@@ -103,6 +103,7 @@ export default {
103103
},
104104
],
105105
},
106+
loginLoading: false
106107
};
107108
},
108109
methods: {
@@ -116,16 +117,26 @@ export default {
116117
if (!valid) {
117118
return;
118119
}
120+
this.loginLoading = true;
121+
// 进行md5加密
122+
const salt = "xiaobaitiao";
123+
const username = this.loginForm.username;
124+
const password = CryptoJS.MD5(salt + this.loginForm.password).toString();
119125
//向数据库发送axios请求,如果登录成功,就跳转
120126
const { data: res } = await this.$http.post(
121127
"admin/login",
122-
this.loginForm
128+
{
129+
username,
130+
password
131+
}
123132
);
124133
// console.log(res);
125134
if (res.status !== 200) {
135+
this.loginLoading = false;
126136
return this.$message.error(res.msg);
127137
}
128138
this.$message.success("登录成功");
139+
this.loginLoading = false;
129140
// console.log(res);
130141
window.sessionStorage.setItem("token", res.map.token);
131142
window.sessionStorage.setItem("adminId", res.map.id);

src/components/BookManage/BookExpire.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ export default {
9999
this.returnInfo.bookNumber = this.expireInfo.bookNumber;
100100
},
101101
async returnBook(){
102+
// 对表单参数进行校验
103+
if(this.returnInfo.returnDate===""){
104+
this.$message.error({
105+
message:"归还日期不能为空",
106+
duration:1000
107+
})
108+
return;
109+
}
102110
this.returnInfo.violationAdminId = parseInt(window.sessionStorage.getItem('bookAdminId'))
103111
const {data:res} = await this.$http.post('bookadmin/return_book',this.returnInfo)
104112
// console.log(res);

src/components/BookManage/BorrowBook.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ export default {
4545
methods: {
4646
async borrowBook(){
4747
// console.log(this.borrowInfo.borrowDate);
48+
if(this.borrowInfo.borrowDate=== ""){
49+
return this.$message.error({
50+
message:"借阅时间不能为空",
51+
duration:1000
52+
})
53+
}
4854
this.borrowInfo.bookAdminId = parseInt(window.sessionStorage.getItem('bookAdminId'))
4955
const {data:res} = await this.$http.post('bookadmin/borrow_book',this.borrowInfo)
50-
console.log(res);
5156
if(res.status !== 200){
5257
return this.$message.error(res.msg)
5358
}

src/components/BookManage/LoginBookManage.vue

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</el-form-item>
3737
<!-- 按钮区域 -->
3838
<el-form-item class="btns">
39-
<el-button type="primary" @click="login">登录</el-button>
39+
<el-button type="primary" @click="login" :loading="loginLoading">登录</el-button>
4040
<el-button type="info" @click="resetLoginForm">重置</el-button>
4141
</el-form-item>
4242
</el-form>
@@ -106,6 +106,7 @@ export default {
106106
},
107107
],
108108
},
109+
loginLoading: false
109110
};
110111
},
111112
methods: {
@@ -119,32 +120,44 @@ export default {
119120
if (!valid) {
120121
return;
121122
}
123+
this.loginLoading = true;
124+
// 进行md5加密
125+
const salt = "xiaobaitiao";
126+
const username = this.loginForm.username;
127+
const password = CryptoJS.MD5(
128+
salt + this.loginForm.password
129+
).toString();
122130
//向数据库发送axios请求,如果登录成功,就跳转
123-
const {data:res} = await this.$http.post('bookadmin/login',this.loginForm)
131+
const { data: res } = await this.$http.post("bookadmin/login", {
132+
username,
133+
password,
134+
});
124135
// console.log(res);
125-
if(res.status !== 200){
126-
return this.$message.error(res.msg);
127-
}
128-
this.$message.success('登录成功')
129-
window.sessionStorage.setItem('token',res.map.token)
130-
window.sessionStorage.setItem('bookAdminId',res.map.id)
131-
this.$router.push('/homemange')
136+
if (res.status !== 200) {
137+
this.loginLoading = false;
138+
return this.$message.error(res.msg);
139+
}
140+
this.$message.success("登录成功");
141+
this.loginLoading = false;
142+
window.sessionStorage.setItem("token", res.map.token);
143+
window.sessionStorage.setItem("bookAdminId", res.map.id);
144+
this.$router.push("/homemange");
132145
// window.sessionStorage.setItem("token", token);
133146
// this.$router.push("/home"); //跳转到home页面下
134147
});
135148
},
136-
goUser(){
137-
this.$router.push('/login');
149+
goUser() {
150+
this.$router.push("/login");
151+
},
152+
goAdmin() {
153+
this.$router.push("/loginadmin");
138154
},
139-
goAdmin(){
140-
this.$router.push('/loginadmin');
141-
}
142155
},
143156
};
144157
</script>
145158

146159
<style lang="less" scoped>
147-
.footer2 {
160+
.footer2 {
148161
position: absolute;
149162
bottom: 0px;
150163
left: 45%;
@@ -155,8 +168,8 @@ export default {
155168
}
156169
.login_container {
157170
// background-color: #2b4b6b;
158-
background: url(http://xxx.xiaobaitiao.club/img/digitalCityMin.png)
159-
no-repeat 0px 0px;
171+
background: url(http://xxx.xiaobaitiao.club/img/digitalCityMin.png) no-repeat
172+
0px 0px;
160173
background-size: cover;
161174
height: 100%;
162175
}

src/components/Home/Home.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
</template>
9090

9191
<script>
92+
93+
9294
export default {
9395
data() {
9496
return {

0 commit comments

Comments
 (0)