{"record":{"id":"012e0db0de17bdd4","repo":"paascloud/paascloud-master","slug":"uac10011002-012e0d","errorCode":"UAC10011002","errorMessage":"ErrorCodeEnum.UAC10011002","messagePattern":"ErrorCodeEnum\\.UAC10011002","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":127,"sourceCode":"\n\t@Override\n\tpublic UacUser findByMobileNo(String mobileNo) {\n\t\treturn uacUserMapper.findByMobileNo(mobileNo);\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic void checkUserIsCorrect(LoginReqDto loginReqDto) {\n\t\tlogger.info(\"用户【\" + loginReqDto.getLoginName() + \"】进行密码认证......\");\n\n\t\tMap<String, String> loginNamePwdMap = Maps.newHashMap();\n\t\tloginNamePwdMap.put(\"loginName\", loginReqDto.getLoginName());\n\t\tloginNamePwdMap.put(\"loginPwd\", loginReqDto.getLoginPwd());\n\n\t\tUacUser uacUser = uacUserMapper.findByLoginNameAndLoginPwd(loginNamePwdMap);\n\t\tif (PublicUtil.isEmpty(uacUser)) {\n\t\t\tlogger.info(\"用户【\" + loginReqDto.getLoginName() + \"】密码认证失败\");\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011002, loginReqDto.getLoginName());\n\t\t}\n\n\t\tlogger.info(\"用户【\" + loginReqDto.getLoginName() + \"】密码认证成功\");\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<Perm> getAllPerms() {\n\t\tlogger.info(\"获取全部的权限...\");\n\t\treturn uacActionMapper.findAllPerms();\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<String> getUserPerms(Long userId) {\n\t\tlogger.info(\"获取用户权限列表userId={}\", userId);\n\n\t\t//1.获取所有菜单权限","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L109-L145","documentation":"UacBizException with code UAC10011002 ('用户密码认证失败' / user password authentication failed) thrown by checkUserIsCorrect when findByLoginNameAndLoginPwd returns no user for the given loginName+loginPwd pair. Either the login name does not exist or the password is wrong; the message includes the attempted login name.","triggerScenarios":"Calling checkUserIsCorrect(loginReqDto) with credentials that do not match any stored user — wrong password, non-existent login name, or password encrypted with a different algorithm/salt than the stored value.","commonSituations":"Users mistyping credentials at login; password encoder configuration changed so hashes no longer match; environment seeded with different user data than the client expects; login name case/whitespace differences.","solutions":["Confirm the login name exists (findByLoginName) before password verification to distinguish wrong-user from wrong-password.","Verify the password encryption algorithm and salt match those used at registration (e.g., MD5/SHA settings in the security config).","Trim/normalize loginName and check case sensitivity handling before the lookup.","If the user forgot the password, direct them through the password-reset flow."],"exampleFix":"// before\nuacUserService.checkUserIsCorrect(loginReqDto);\n// after\nUacUser user = uacUserService.findByLoginName(loginReqDto.getLoginName());\nif (user == null) {\n    throw new UacBizException(ErrorCodeEnum.UAC10011003, loginReqDto.getLoginName());\n}\nuacUserService.checkUserIsCorrect(loginReqDto);","handlingStrategy":"try-catch","validationCode":"if (loginReqDto == null || PublicUtil.isBlank(loginReqDto.getLoginName()) || PublicUtil.isBlank(loginReqDto.getLoginPwd())) { throw new IllegalArgumentException(\"loginName/loginPwd required\"); }","typeGuard":"boolean credentialsPresent = loginReqDto != null && loginReqDto.getLoginName() != null && loginReqDto.getLoginPwd() != null;","tryCatchPattern":"try {\n    uacUserService.checkUserIsCorrect(loginReqDto);\n} catch (UacBizException e) {\n    if (\"UAC10011002\".equals(e.getCode())) { throw new BadCredentialsException(\"用户名或密码错误\"); }\n    throw e;\n}","preventionTips":["Normalize (trim, lowercase) login names before authentication","Keep the password hashing algorithm and salt consistent between registration and login","Provide clear reset-password flows for locked-out users","Log failed attempts with the login name for diagnosis"],"tags":["authentication","login","invalid-credentials"],"backgroundTag":"authentication-required","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"}