From b334cd13d14f7f394e4827dadcfe2c15f03612d2 Mon Sep 17 00:00:00 2001 From: lijiaqi Date: Thu, 8 Aug 2024 11:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=BC=BA=E5=BA=A6=E8=A7=84=E5=88=99=E5=92=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=E9=83=A8=E5=88=86=E4=B8=9A=E5=8A=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E3=80=82-=20=E6=9B=B4=E6=96=B0=E4=BA=86=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=BA=86=E5=AF=86=E7=A0=81=E8=A6=81=E6=B1=82?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=AF=86=E7=A0=81=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E8=8B=B1=E6=96=87=E3=80=81=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E5=92=8C=E7=89=B9=E6=AE=8A=E7=AC=A6=E5=8F=B7=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E8=87=B3=E5=B0=918=E4=BD=8D=E3=80=82=20-=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E7=94=A8=E6=88=B7=E5=88=9D=E5=A7=8B=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC=EF=BC=8C=E6=8F=90=E5=8D=87?= =?UTF-8?q?=E4=BA=86=E7=B3=BB=E7=BB=9F=E7=9A=84=E5=AE=89=E5=85=A8=E6=80=A7?= =?UTF-8?q?=E3=80=82=20-=20=E7=A7=BB=E9=99=A4=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81=E5=92=8C?= =?UTF-8?q?=E5=86=97=E4=BD=99=E6=B3=A8=E9=87=8A=EF=BC=8C=E6=B8=85=E7=90=86?= =?UTF-8?q?=E4=BA=86=E4=BB=A3=E7=A0=81=E5=BA=93=E3=80=82-=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=E9=83=A8=E5=88=86=E6=9C=8D=E5=8A=A1=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=EF=BC=8C=E6=8F=90=E9=AB=98=E4=BA=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E8=AF=BB=E6=80=A7=E5=92=8C=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ydool/common/utils/PasswordUtil.java | 17 +++-------------- .../userdept/impl/UserDeptServiceImpl.java | 2 +- .../workFlow/controller/WorkFlowController.java | 7 ++++--- .../service/impl/BudgetWorkFlowService.java | 6 +++--- .../workFlow/service/WorkFlowNoticeService.java | 3 ++- .../system/service/impl/AuthServiceImpl.java | 6 +++--- .../system/service/impl/UserServiceImpl.java | 4 ++-- 7 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/ydool/common/utils/PasswordUtil.java b/src/main/java/com/ydool/common/utils/PasswordUtil.java index fc2876f..37704c0 100644 --- a/src/main/java/com/ydool/common/utils/PasswordUtil.java +++ b/src/main/java/com/ydool/common/utils/PasswordUtil.java @@ -66,9 +66,10 @@ public class PasswordUtil { * @return String */ public static String checkp(String pwd) { - String str = "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[!\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~])[A-Za-z\\d !\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~]{10,36}$"; +// String str = "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[!\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~])[A-Za-z\\d !\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~]{10,36}$"; + String str = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~`]).{8,}$"; if (!pwd.matches(str)) { - return "密码至少由10位及以上大小写字母、数字及特殊字符等混合、随机组成(至少包括数字、小写字母、大写字母和特殊符号各一个),最长36位"; + return "密码必须英文+数字+特殊符号,至少8位"; } else { return "ok"; } @@ -118,18 +119,6 @@ public class PasswordUtil { if (!"ok".equals(check)) { throw new ResultException(check); - } else if (!"ok".equals(rsThree)) { - throw new ResultException(rsThree); - } else if (!"ok".equals(repeat)) { - throw new ResultException(repeat); - } else if (!"ok".equals(checkBirthday)) { - throw new ResultException(checkBirthday); - } else if (!"ok".equals(check3)) { - throw new ResultException(check3); - } else if (!"ok".equals(checkMobile)) { - throw new ResultException(checkMobile); - } else if (!"ok".equals(checkPhone)) { - throw new ResultException(checkPhone); } else { return true; } diff --git a/src/main/java/com/ydool/oa/formily/userdept/impl/UserDeptServiceImpl.java b/src/main/java/com/ydool/oa/formily/userdept/impl/UserDeptServiceImpl.java index ba848cd..0f33c6e 100644 --- a/src/main/java/com/ydool/oa/formily/userdept/impl/UserDeptServiceImpl.java +++ b/src/main/java/com/ydool/oa/formily/userdept/impl/UserDeptServiceImpl.java @@ -211,7 +211,7 @@ public class UserDeptServiceImpl implements IUserDeptService { result.set("deptName", deptName); String initPassword = ConfigCache.getStr(ConfigCache.USER_INIT_PASSWORD, - "888888"); + "xslc@2025"); initPassword = PasswordUtil.password(loginUser.getSalt(), initPassword); //是否需要强制修改密码 diff --git a/src/main/java/com/ydool/oa/workFlow/controller/WorkFlowController.java b/src/main/java/com/ydool/oa/workFlow/controller/WorkFlowController.java index 81985f8..bb10947 100644 --- a/src/main/java/com/ydool/oa/workFlow/controller/WorkFlowController.java +++ b/src/main/java/com/ydool/oa/workFlow/controller/WorkFlowController.java @@ -199,7 +199,8 @@ public class WorkFlowController extends BaseController { @ApiOperation(value = "分页查询自己有关的流程通知") @ApiImplicitParams({ @ApiImplicitParam(name = "current", value = "当前页", dataType = "Integer"), - @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer") + @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer"), + @ApiImplicitParam(name = "isRead", value = "是否已读 true已读 false未读", dataType = "String") }) @ApiOperationSupport( responses = @DynamicResponseParameters(properties = { @@ -207,8 +208,8 @@ public class WorkFlowController extends BaseController { }), order = 9 ) - public AjaxResult workFlowNoticePageList() { - return workFlowNoticeService.workFlowNoticePageList(getPage()); + public AjaxResult workFlowNoticePageList(String isRead) { + return workFlowNoticeService.workFlowNoticePageList(getPage(), "true".equals(isRead) ? Boolean.TRUE : Boolean.FALSE); } diff --git a/src/main/java/com/ydool/oa/workFlow/engine/service/impl/BudgetWorkFlowService.java b/src/main/java/com/ydool/oa/workFlow/engine/service/impl/BudgetWorkFlowService.java index dd28d9b..3c4598c 100644 --- a/src/main/java/com/ydool/oa/workFlow/engine/service/impl/BudgetWorkFlowService.java +++ b/src/main/java/com/ydool/oa/workFlow/engine/service/impl/BudgetWorkFlowService.java @@ -69,9 +69,9 @@ public class BudgetWorkFlowService implements IWorkFlowType { public AjaxResult first(WorkFlow workFlow) { //是否维修上报角色 User user = userService.getById(workFlow.getUserId()); - List roles = roleService.listByIds(Arrays.asList(user.getRoles().split(","))); - List roleNames = roles.stream().map(Role::getName).collect(Collectors.toList()); - if (!roleNames.contains("维修上报")) throw new ResultException("您不是维修上报人员"); +// List roles = roleService.listByIds(Arrays.asList(user.getRoles().split(","))); +// List roleNames = roles.stream().map(Role::getName).collect(Collectors.toList()); +// if (!roleNames.contains("维修上报")) throw new ResultException("您不是维修上报人员"); Dept dept = deptService.getById(user.getDept()); if (ObjUtil.isNull(dept)) throw new ResultException("您没有部门"); diff --git a/src/main/java/com/ydool/oa/workFlow/service/WorkFlowNoticeService.java b/src/main/java/com/ydool/oa/workFlow/service/WorkFlowNoticeService.java index ba0ab3d..f661bd4 100644 --- a/src/main/java/com/ydool/oa/workFlow/service/WorkFlowNoticeService.java +++ b/src/main/java/com/ydool/oa/workFlow/service/WorkFlowNoticeService.java @@ -29,9 +29,10 @@ public class WorkFlowNoticeService extends BaseService pageList = page(page, new QueryWrapper().lambda() .eq(WorkFlowNotice::getUserId, StpUtil.getLoginIdAsString()) + .eq(ObjUtil.isNotNull(isRead), WorkFlowNotice::getStatus, isRead) .orderByDesc(WorkFlowNotice::getCreatedAt) ); return AjaxResult.ok().data(pageList); diff --git a/src/main/java/com/ydool/system/service/impl/AuthServiceImpl.java b/src/main/java/com/ydool/system/service/impl/AuthServiceImpl.java index 1d6b8c5..d4a76d8 100644 --- a/src/main/java/com/ydool/system/service/impl/AuthServiceImpl.java +++ b/src/main/java/com/ydool/system/service/impl/AuthServiceImpl.java @@ -226,7 +226,7 @@ public class AuthServiceImpl extends BaseService implements IA //是否需要强制修改密码 result.set("need_init_password", password.equals(ConfigCache.getStr(ConfigCache.USER_INIT_PASSWORD, - "Siwhnd!@Lc2349#!Rdisabled")) ? true : false); + "xslc@2025")) ? true : false); //权限 result.set("permissions", loginUser.getPermissions()); //电子签名 @@ -259,7 +259,7 @@ public class AuthServiceImpl extends BaseService implements IA */ @Override public AjaxResult editPassword(String oldPassword, String newPassword) { - if (!PasswordUtil.valid(newPassword)) return AjaxResult.fail("密码必须同时包含大写字母、小写字母、数字和特殊字符,并且长度至少为8位,最长24位"); + if (!PasswordUtil.valid(newPassword)) return AjaxResult.fail("密码必须英文+数字+特殊符号,至少8位"); String loginId = StpUtil.getLoginIdAsString(); User user = getById(loginId); if (!user.getPassword().equals(PasswordUtil.password(user.getSalt(), oldPassword))) return AjaxResult.fail( @@ -281,7 +281,7 @@ public class AuthServiceImpl extends BaseService implements IA */ @Override public AjaxResult newPassword(String newPassword) { - if (!PasswordUtil.valid(newPassword)) return AjaxResult.fail("密码必须同时包含大写字母、小写字母、数字和特殊字符,并且长度至少为8位,最长24位"); + if (!PasswordUtil.valid(newPassword)) return AjaxResult.fail("密码必须英文+数字+特殊符号,至少8位"); String loginId = StpUtil.getLoginIdAsString(); String salt = RandomUtil.randomString(6); String password = PasswordUtil.password(salt, newPassword); diff --git a/src/main/java/com/ydool/system/service/impl/UserServiceImpl.java b/src/main/java/com/ydool/system/service/impl/UserServiceImpl.java index 3530ad8..45c5033 100644 --- a/src/main/java/com/ydool/system/service/impl/UserServiceImpl.java +++ b/src/main/java/com/ydool/system/service/impl/UserServiceImpl.java @@ -66,7 +66,7 @@ public class UserServiceImpl extends BaseService implements IU if (StrUtil.isNotBlank(message)) return AjaxResult.fail(message); User user = BeanUtil.copyProperties(userRequest, User.class); user.setPhone(CodecUtils.encrypt(user.getPhone())); - String initPassword = ConfigCache.getStr(ConfigCache.USER_INIT_PASSWORD, "Siwhnd!@Lc2349#!Rdisabled"); + String initPassword = ConfigCache.getStr(ConfigCache.USER_INIT_PASSWORD, "xslc@2025"); PasswordUtil.valid(initPassword); user.setSalt(RandomUtil.randomString(6)); user.setPassword(PasswordUtil.password(user.getSalt(), initPassword)); @@ -199,7 +199,7 @@ public class UserServiceImpl extends BaseService implements IU User user = getById(id); if (ObjectUtil.isNull(user)) return AjaxResult.fail("该用户不存在"); - String initPassword = ConfigCache.getStr(ConfigCache.USER_INIT_PASSWORD, "Siwhnd!@Lc2349#!Rdisabled"); + String initPassword = ConfigCache.getStr(ConfigCache.USER_INIT_PASSWORD, "xslc@2025"); PasswordUtil.valid(initPassword); user.setSalt(RandomUtil.randomString(6)); user.setPassword(PasswordUtil.password(user.getSalt(), initPassword));