修复I5TUL1问题-编辑用户信息字段超长

This commit is contained in:
zhangliang 2022-09-30 14:52:11 +08:00
parent f3b10f07b1
commit e16fc88e81
2 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@
</el-form-item>
<el-form-item label="账号:">
{{ formData.username }}
<popover-input class="ml-[10px]" @confirm="handleEdit($event, 'username')">
<popover-input class="ml-[10px]" @confirm="handleEdit($event, 'username')" limit="32">
<el-button type="primary" link v-perms="['user:edit']">
<icon name="el-icon-EditPen" />
</el-button>
@ -23,7 +23,7 @@
</el-form-item>
<el-form-item label="真实姓名:">
{{ formData.realName || '-' }}
<popover-input class="ml-[10px]" @confirm="handleEdit($event, 'realName')">
<popover-input class="ml-[10px]" @confirm="handleEdit($event, 'realName')" limit="32">
<el-button type="primary" link v-perms="['user:edit']">
<icon name="el-icon-EditPen" />
</el-button>

View File

@ -164,19 +164,19 @@ public class UserServiceImpl implements IUserService {
throw new OperateException("当前账号已存在!");
}
}
Assert.isTrue(value.length() <= 32,"账号不能超过32个字符");
user.setUsername(value);
break;
case "realName":
Assert.isTrue(value.length() <= 32,"真实姓名不能超过32个字符");
user.setRealName(value);
break;
case "sex":
user.setSex(Integer.parseInt(value));
break;
case "mobile":
if (!value.equals("")) {
if(!Pattern.matches("^[1][3,4,5,6,7,8,9][0-9]{9}$", value)){
throw new OperateException("手机号格式不正确!");
}
if (!Pattern.matches("^[1][3,4,5,6,7,8,9][0-9]{9}$", value)) {
throw new OperateException("手机号格式不正确!");
}
user.setMobile(value);
break;