jeecgboot/JeecgBoot · warning · JeecgBootException

请填写原手机号!

Error message

请填写原手机号!

What it means

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.

Source

Thrown at jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java:2077

	@Override
	public void checkUserAdminRejectDel(String userIds) {
		LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
		query.in(SysUser::getId,Arrays.asList(userIds.split(SymbolConstant.COMMA)));
		query.eq(SysUser::getUsername,"admin");
		Long adminRoleCount = this.baseMapper.selectCount(query);
		//大于0说明存在管理员用户,不允许删除
		if(adminRoleCount>0){
			throw new JeecgBootException("admin用户,不允许删除!");
		}
	}

	@Override
	public void changePhone(JSONObject json, String username) {
		String smscode = json.getString("smscode");
		String phone = json.getString("phone");
		String type = json.getString("type");
		if(oConvertUtils.isEmpty(phone)){
			throw new JeecgBootException("请填写原手机号!");
		}
		if(oConvertUtils.isEmpty(smscode)){
			throw new JeecgBootException("请填写验证码!");
		}
		//step1 验证原手机号是否和当前用户匹配
		SysUser sysUser = userMapper.getUserByNameAndPhone(phone,username);
		if (null == sysUser){
			throw new JeecgBootException("原手机号不匹配,无法修改密码!");
		}
		//step2 根据类型判断是验证原手机号的验证码还是新手机号的验证码
		//验证原手机号
		if(CommonConstant.VERIFY_ORIGINAL_PHONE.equals(type)){
			this.verifyPhone(phone, smscode);
		}else if(CommonConstant.UPDATE_PHONE.equals(type)){
			//修改手机号
			String newPhone = json.getString("newPhone");
			//需要验证新手机号和原手机号是否一致,一致不让修改
			if(newPhone.equals(phone)){

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Ensure the request body includes a non-empty 'phone' field matching the original phone number.
  2. Validate the form field name is exactly 'phone'.
  3. Add client-side required-field validation for phone before submit.

Example fix

// before: { "smscode": "1234" }  // missing phone

// after: { "phone": "13800000000", "smscode": "1234", "type": "1" }
Defensive patterns

Strategy: validation

Validate before calling

String phone = json.getString("phone");
if (oConvertUtils.isEmpty(phone)) return Result.error("请填写原手机号");

Type guard

boolean hasPhone(JSONObject json) {
  String p = json.getString("phone");
  return p != null && !p.trim().isEmpty();
}

Try / catch

try { userService.changePhone(json, username); }
catch (JeecgBootException e) {
  if (e.getMessage().contains("原手机号")) return Result.error("请填写原手机号");
  throw e;
}

Prevention

When it happens

Trigger: POST to changePhone with a JSON body where 'phone' is null, empty, or whitespace.

Common situations: Frontend forgot to include the phone field; field name mismatch (e.g. 'oldPhone' vs 'phone'); user submitted the form without entering the original phone.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/73c64e4955cb1f35. Report an issue: GitHub.