diff --git a/src/main/java/com/msdw/tms/config/EmailUtils.java b/src/main/java/com/msdw/tms/config/EmailUtils.java index cee3b26..1f2e9de 100644 --- a/src/main/java/com/msdw/tms/config/EmailUtils.java +++ b/src/main/java/com/msdw/tms/config/EmailUtils.java @@ -30,6 +30,8 @@ public class EmailUtils { try { HtmlEmail email = new HtmlEmail(); email.setHostName(SERVER_ADDRESS); + email.setSSLOnConnect(true); //使用ssl加密true + email.setSslSmtpPort("465"); //使用465端口 email.setCharset("UTF-8"); email.addTo(emailaddress); diff --git a/src/main/java/com/msdw/tms/controller/UserInfoController.java b/src/main/java/com/msdw/tms/controller/UserInfoController.java index 3e1578d..1ea72ce 100644 --- a/src/main/java/com/msdw/tms/controller/UserInfoController.java +++ b/src/main/java/com/msdw/tms/controller/UserInfoController.java @@ -182,6 +182,12 @@ public class UserInfoController implements UserInfoControllerApi { UserInfoEntity userInfo = vo.getUserInfoEntity(); Integer userId = userInfo.getUserId(); String password = userInfo.getPassword(); + + //验证账号是否存在 + int num = userInfoService.queryAccountExist(userInfo.getAccount()); + if (num >= 1){ + return R.error(500,"更新失败,账号不能重复"); + } String userPassword = userInfoService.queryPasword(userId); if (userPassword.equals(password)==true){ return R.error(400,"false,the password is the same!!!"); diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index b1a3cfc..ccdb1fc 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -66,4 +66,6 @@ public interface UserInfoDao extends BaseMapper { List queryStudentName(Integer userId); Integer getUserId(String token); + + Integer queryAccountExist(String account); } diff --git a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java index 6132610..9dc2a0b 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java @@ -98,7 +98,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable * 实验班级名 */ private String experimentalClassName; - + /** + * 实验名称 + */ + private String experimentalName; /** * 封装多个项目id */ diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index 2948e42..59b44e0 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -50,4 +50,5 @@ public interface UserInfoService extends IService { R getUserId(String token); + Integer queryAccountExist(String account); } diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index ee92bb8..8edb4c7 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -178,13 +178,13 @@ public class ProjectRecordServiceImpl extends ServiceImpl + + \ No newline at end of file