{"record":{"id":"73c64e4955cb1f35","repo":"jeecgboot/JeecgBoot","slug":"error-73c64e","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":2077,"sourceCode":"\t@Override\n\tpublic void checkUserAdminRejectDel(String userIds) {\n\t\tLambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();\n\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)){","sourceCodeStart":2059,"sourceCodeEnd":2095,"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#L2059-L2095","documentation":"Thrown by SysUserServiceImpl.changePhone when the 'phone' field in the JSON payload is empty (oConvertUtils.isEmpty). It is the first input check before any DB lookup.","triggerScenarios":"POST to changePhone with a JSON body where 'phone' is null, empty, or whitespace.","commonSituations":"Frontend forgot to include the phone field; field name mismatch (e.g. 'oldPhone' vs 'phone'); user submitted the form without entering the original phone.","solutions":["Ensure the request body includes a non-empty 'phone' field matching the original phone number.","Validate the form field name is exactly 'phone'.","Add client-side required-field validation for phone before submit."],"exampleFix":"// before: { \"smscode\": \"1234\" }  // missing phone\n\n// after: { \"phone\": \"13800000000\", \"smscode\": \"1234\", \"type\": \"1\" }","handlingStrategy":"validation","validationCode":"String phone = json.getString(\"phone\");\nif (oConvertUtils.isEmpty(phone)) return Result.error(\"请填写原手机号\");","typeGuard":"boolean hasPhone(JSONObject json) {\n  String p = json.getString(\"phone\");\n  return p != null && !p.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":["Add client-side required-field validation for phone.","Confirm field name is 'phone'."],"tags":["validation","phone","input-validation"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}