{"record":{"id":"e9bf181efe2780bc","repo":"jeecgboot/JeecgBoot","slug":"error-e9bf18","errorCode":null,"errorMessage":"请填写验证码！","messagePattern":"请填写验证码！","errorType":"exception","errorClass":"JeecgBootException","httpStatus":null,"severity":"warning","filePath":"jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java","lineNumber":2080,"sourceCode":"\t\tquery.in(SysUser::getId,Arrays.asList(userIds.split(SymbolConstant.COMMA)));\n\t\tquery.eq(SysUser::getUsername,\"admin\");\n\t\tLong adminRoleCount = this.baseMapper.selectCount(query);\n\t\t//大于0说明存在管理员用户，不允许删除\n\t\tif(adminRoleCount>0){\n\t\t\tthrow new JeecgBootException(\"admin用户，不允许删除！\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic void changePhone(JSONObject json, String username) {\n\t\tString smscode = json.getString(\"smscode\");\n\t\tString phone = json.getString(\"phone\");\n\t\tString type = json.getString(\"type\");\n\t\tif(oConvertUtils.isEmpty(phone)){\n\t\t\tthrow new JeecgBootException(\"请填写原手机号！\");\n\t\t}\n\t\tif(oConvertUtils.isEmpty(smscode)){\n\t\t\tthrow new JeecgBootException(\"请填写验证码！\");\n\t\t}\n\t\t//step1 验证原手机号是否和当前用户匹配\n\t\tSysUser sysUser = userMapper.getUserByNameAndPhone(phone,username);\n\t\tif (null == sysUser){\n\t\t\tthrow new JeecgBootException(\"原手机号不匹配，无法修改密码！\");\n\t\t}\n\t\t//step2 根据类型判断是验证原手机号的验证码还是新手机号的验证码\n\t\t//验证原手机号\n\t\tif(CommonConstant.VERIFY_ORIGINAL_PHONE.equals(type)){\n\t\t\tthis.verifyPhone(phone, smscode);\n\t\t}else if(CommonConstant.UPDATE_PHONE.equals(type)){\n\t\t\t//修改手机号\n\t\t\tString newPhone = json.getString(\"newPhone\");\n\t\t\t//需要验证新手机号和原手机号是否一致，一致不让修改\n\t\t\tif(newPhone.equals(phone)){\n\t\t\t\tthrow new JeecgBootException(\"新手机号与原手机号一致，无法修改！\");\n\t\t\t}\n\t\t\tthis.verifyPhone(newPhone, smscode);","sourceCodeStart":2062,"sourceCodeEnd":2098,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java#L2062-L2098","documentation":"Thrown by SysUserServiceImpl.changePhone when 'smscode' is empty. It is the second input check, after phone presence.","triggerScenarios":"POST to changePhone with a JSON body where 'smscode' is null/empty/whitespace.","commonSituations":"User submitted before entering the SMS code; field name mismatch ('code' vs 'smscode'); SMS never arrived so the field was left blank.","solutions":["Ensure the request body includes a non-empty 'smscode'.","Validate the form field name is exactly 'smscode'.","If SMS did not arrive, trigger sendChangePhoneSms first, then submit the code."],"exampleFix":"// before: { \"phone\": \"13800000000\", \"type\": \"1\" }  // missing smscode\n\n// after: { \"phone\": \"13800000000\", \"smscode\": \"1234\", \"type\": \"1\" }","handlingStrategy":"validation","validationCode":"String smscode = json.getString(\"smscode\");\nif (oConvertUtils.isEmpty(smscode)) return Result.error(\"请填写验证码\");","typeGuard":"boolean hasSmsCode(JSONObject json) {\n  String c = json.getString(\"smscode\");\n  return c != null && !c.trim().isEmpty();\n}","tryCatchPattern":"try { userService.changePhone(json, username); }\ncatch (JeecgBootException e) {\n  if (e.getMessage().contains(\"验证码\")) return Result.error(\"请填写验证码\");\n  throw e;\n}","preventionTips":["Trigger sendChangePhoneSms before submitting the verify step.","Confirm field name is 'smscode'."],"tags":["validation","phone","sms","input-validation"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}