修复漏洞
This commit is contained in:
1 parent
bb0b8bd7ef
commit
b31a77334a
2 files changed
+17
-16
No files matched your search
+15
-15
@@ -96,8 +96,8 @@ public class SysUserController {
|
||||
/** 复用原 UserExcelVO 的分批导出。 */
|
||||
private final com.bsd.pjcloud.admin.service.impl.SysUserBatchExportService batchExportService;
|
||||
|
||||
/** 异步修复「密码=手机号」弱口令。 */
|
||||
private final com.bsd.pjcloud.admin.service.impl.SysUserFixPhonePasswordService fixPhonePasswordService;
|
||||
// 线上已执行完,暂时关闭修复弱口令入口
|
||||
// private final com.bsd.pjcloud.admin.service.impl.SysUserFixPhonePasswordService fixPhonePasswordService;
|
||||
|
||||
private final SysUserService userService;
|
||||
|
||||
@@ -440,20 +440,20 @@ public class SysUserController {
|
||||
return userService.checkPassword(SecurityUtils.getUser().getUsername(), password);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步修复「密码=手机号」弱口令:立即返回任务进度,前端轮询;完成后可下载名单 txt。
|
||||
* body: { "password": "PjHq@2024Fix!" }
|
||||
/*
|
||||
* 线上已执行完,暂时关闭修复弱口令接口(需恢复时取消注释,并恢复上方 fixPhonePasswordService 注入)
|
||||
*
|
||||
* @SysLog("修复密码等于手机号的弱口令")
|
||||
* @PostMapping("/fix-phone-as-password")
|
||||
* @HasPermission("sys_user_edit")
|
||||
* public R<com.bsd.pjcloud.common.asynctask.vo.AsyncTaskProgressVO> fixPhoneAsPassword(@RequestBody UserDTO body) {
|
||||
* String newPassword = body != null ? body.getPassword() : null;
|
||||
* if (newPassword == null && body != null) {
|
||||
* newPassword = body.getNewpassword1();
|
||||
* }
|
||||
* return R.ok(fixPhonePasswordService.submit(newPassword), "弱口令修复任务已提交");
|
||||
* }
|
||||
*/
|
||||
@SysLog("修复密码等于手机号的弱口令")
|
||||
@PostMapping("/fix-phone-as-password")
|
||||
@HasPermission("sys_user_edit")
|
||||
public R<com.bsd.pjcloud.common.asynctask.vo.AsyncTaskProgressVO> fixPhoneAsPassword(@RequestBody UserDTO body) {
|
||||
String newPassword = body != null ? body.getPassword() : null;
|
||||
if (newPassword == null && body != null) {
|
||||
newPassword = body.getNewpassword1();
|
||||
}
|
||||
return R.ok(fixPhonePasswordService.submit(newPassword), "弱口令修复任务已提交");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色ID列表获取用户ID列表接口
|
||||
|
||||
+2
-1
@@ -39,9 +39,10 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 异步扫描并修复「密码=手机号」弱口令:分页处理,避免 HTTP 超时;逐条提交,避免超长事务。
|
||||
* <p>线上已执行完,Controller 入口已关闭;@Service 一并注释,避免无用 Bean;恢复时取消注释即可。</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
// @Service
|
||||
public class SysUserFixPhonePasswordService {
|
||||
|
||||
public static final String REDIS_KEY = "admin:fix:phone-password";
|
||||
|
||||
Reference in new issue
Block a user