Skip to content

Commit 5a8b0d6

Browse files
committed
修改了一些bug”
1 parent 20f4cfc commit 5a8b0d6

File tree

6 files changed

+5
-53
lines changed

6 files changed

+5
-53
lines changed

src/main/java/com/niit/sms/controller/HeadController.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/java/com/niit/sms/controller/StudentController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.niit.sms.bean.Student;
44
import com.niit.sms.service.StudentService;
5+
import com.niit.sms.utils.MD5Util;
56
import org.springframework.beans.factory.annotation.Autowired;
67
import org.springframework.stereotype.Controller;
78
import org.springframework.web.bind.annotation.RequestMapping;
@@ -61,7 +62,6 @@ public Object addStudent(Student student) {
6162
@RequestMapping("/del")
6263
@ResponseBody
6364
public Object delStudentById(Integer id) {
64-
System.out.println(id);
6565
Map<String, Object> dataMap= new HashMap<>();
6666
dataMap.put("code",0);
6767
dataMap.put("data",studentrService.delStudentById(id));
@@ -71,6 +71,9 @@ public Object delStudentById(Integer id) {
7171
@RequestMapping("/update")
7272
@ResponseBody
7373
public Object updateStudentById(Student student) {
74+
if(!student.getPassword().isEmpty()){
75+
student.setPassword(MD5Util.MD5Lower(student.getPassword()));
76+
}
7477
System.out.println("=====>修改:"+student);
7578
Map<String, Object> dataMap= new HashMap<>();
7679
dataMap.put("code",0);

src/main/java/com/niit/sms/service/impl/StudentServiceImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public int delStudentById(Integer id) {
4242

4343
@Override
4444
public int updateStudentById(Student student) {
45-
String lower = MD5Util.MD5Lower(student.getPassword());
46-
student.setPassword(lower);
4745
return studentMapper.updateStudentById(student);
4846
}
4947

src/main/java/com/niit/sms/service/impl/TeacherServiceImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public int insertTeacher(Teacher teacher) {
4040

4141
@Override
4242
public int updateTeacher(Teacher teacher) {
43-
String lower = MD5Util.MD5Lower(teacher.getPassword());
44-
teacher.setPassword(lower);
4543
return teacherMapper.updateTeacher(teacher);
4644
}
4745

src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ spring:
66
url: jdbc:mysql://localhost:3306/ssm_sms?serverTimezone=CTT&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
77
driver-class-name: com.mysql.cj.jdbc.Driver
88
username: root
9-
password: 123456
9+
password: 123568
1010
thymeleaf:
1111
prefix: classpath:/templates/
1212
suffix: .html

src/main/resources/static/js/stuList.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ layui.use(['form', 'table', 'upload', 'element', 'layer', 'jquery'], function ()
209209
async:false,
210210
success:function (resData) {
211211
$.each(resData, function (index,value) {
212-
console.log(resData);
213212
clazz.append(new Option(value.clazz_name,value.id));
214213
})
215214
}

0 commit comments

Comments
 (0)