{"record":{"id":"3bdbebc0dd38583d","repo":"paascloud/paascloud-master","slug":"uac10011031-3bdbeb","errorCode":"UAC10011031","errorMessage":"验证码超时, 请重新发送验证码","messagePattern":"验证码超时, 请重新发送验证码","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java","lineNumber":874,"sourceCode":"\t\tString loginPwd = forgetResetPasswordDto.getLoginPwd();\n\t\tString loginName = forgetResetPasswordDto.getLoginName();\n\t\tString email = forgetResetPasswordDto.getEmail();\n\t\tString emailCode = forgetResetPasswordDto.getEmailCode();\n\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(loginName), ErrorCodeEnum.UAC10011007.msg());\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(email), ErrorCodeEnum.UAC10011018.msg());\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(loginPwd), ErrorCodeEnum.UAC10011014.msg());\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(forgetToken), \"非法操作\");\n\t\tPreconditions.checkArgument(!StringUtils.isEmpty(emailCode), \"验证码不能为空\");\n\n\t\t// 验证token\n\t\tString key = RedisKeyUtil.getResetPwdTokenKey(email);\n\t\tString forgetKey = redisService.getKey(key);\n\n\t\ttry {\n\t\t\tHttpAesUtil.decrypt(forgetToken, forgetKey, false, forgetKey);\n\t\t} catch (Exception e) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011031);\n\t\t}\n\n\t\tint count = this.countUserByLoginNameAndEmail(loginName, email);\n\t\t// 校验token\n\t\tif (count < 1) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011032, loginName, email);\n\t\t}\n\t}\n\n\t/**\n\t * 删除用户菜单表\n\t */\n\tprivate int deleteUserMenuList(UacUserMenu uacUserMenu) {\n\t\tint selCount = uacUserMenuMapper.selectCount(uacUserMenu);\n\t\t// 如果查询结果为空, 默认认为已删除成功\n\t\tif (selCount < 1) {\n\t\t\treturn 1;\n\t\t}","sourceCodeStart":856,"sourceCodeEnd":892,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L856-L892","documentation":"UAC10011031 is thrown by the reset-password flow when HttpAesUtil.decrypt fails on the value stored under RedisKeyUtil.getResetPwdTokenKey(email). The token is AES-encrypted with a key read from Redis (forgetKey); if that key has expired or the stored value is not decryptable, the flow aborts with '验证码超时' (verification code timed out) and asks the user to request a new code.","triggerScenarios":"User submits the reset-password form after the reset token TTL in Redis expired; Redis restarted/flushed losing the forgetKey or the token; a different Redis instance/prefix between 'send code' and 'reset password'; token value corrupted in Redis.","commonSituations":"Long gap between requesting the code and submitting the form; dev environment sharing one Redis with flushall; mismatched spring.redis database indexes across UAC nodes behind a load balancer.","solutions":["Re-request the reset-password code so fresh forgetKey/token values are written to Redis, then retry promptly.","Increase the TTL used when storing the reset token and the forgetKey.","Verify all UAC instances use the same Redis host/database and key prefix (RedisKeyUtil.getResetPwdTokenKey).","Catch UacBizException(UAC10011031) in the controller and return a clear 'code expired, resend' response rather than a 500."],"exampleFix":"// before\nString forgetKey = redisService.getKey(key); // may be null after TTL\nHttpAesUtil.decrypt(forgetToken, forgetKey, false, forgetKey);\n// after\nif (StringUtils.isEmpty(forgetKey)) {\n    throw new UacBizException(ErrorCodeEnum.UAC10011031);\n}\nHttpAesUtil.decrypt(forgetToken, forgetKey, false, forgetKey);","handlingStrategy":"try-catch","validationCode":"String key = RedisKeyUtil.getResetPwdTokenKey(email);\nString forgetKey = redisService.getKey(key);\nif (StringUtils.isEmpty(forgetKey)) {\n    return Result.fail(\"reset code expired, please request a new one\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    resetPwdService.resetPwd(loginName, email, ...);\n} catch (UacBizException e) {\n    if (\"UAC10011031\".equals(e.getCode())) { return Result.fail(410, \"code expired, resend\"); }\n    throw e;\n}","preventionTips":["Resend the code as soon as it expires; don't retry the old one.","Increase the reset-token TTL and surface remaining validity to the user.","Ensure all UAC nodes use the same Redis host/database and key prefix.","Avoid flushall on shared dev Redis while reset flows are in flight."],"tags":["redis","verification-code","token-expired","reset-password"],"backgroundTag":"jwt-token-expired","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}