优化代码

This commit is contained in:
RuoYi 2023-11-28 12:33:12 +08:00
parent f250ec776a
commit bf773076a8
3 changed files with 7 additions and 6 deletions

View File

@ -33,7 +33,7 @@
// // 集群配置 // // 集群配置
// prop.put("org.quartz.jobStore.isClustered", "true"); // prop.put("org.quartz.jobStore.isClustered", "true");
// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); // prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); // prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "false"); // prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "false");
// //
// // sqlserver 启用 // // sqlserver 启用

View File

@ -67,11 +67,11 @@ public class SysProfileController extends BaseController
currentUser.setSex(user.getSex()); currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{ {
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
} }
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
{ {
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
} }
if (userService.updateUserProfile(currentUser) > 0) if (userService.updateUserProfile(currentUser) > 0)
{ {
@ -100,10 +100,11 @@ public class SysProfileController extends BaseController
{ {
return error("新密码不能与旧密码相同"); return error("新密码不能与旧密码相同");
} }
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) newPassword = SecurityUtils.encryptPassword(newPassword);
if (userService.resetUserPwd(userName, newPassword) > 0)
{ {
// 更新缓存用户密码 // 更新缓存用户密码
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); loginUser.getUser().setPassword(newPassword);
tokenService.setLoginUser(loginUser); tokenService.setLoginUser(loginUser);
return success(); return success();
} }

View File

@ -37,7 +37,7 @@ public interface SysUserPostMapper
/** /**
* 批量新增用户岗位信息 * 批量新增用户岗位信息
* *
* @param userPostList 用户角色列表 * @param userPostList 用户岗位列表
* @return 结果 * @return 结果
*/ */
public int batchUserPost(List<SysUserPost> userPostList); public int batchUserPost(List<SysUserPost> userPostList);