提交20241230

This commit is contained in:
Mrking 2024-12-30 22:03:08 +08:00
parent cc27de49b7
commit 1fbc4ebe52
2 changed files with 6 additions and 3 deletions

View File

@ -101,6 +101,7 @@ public class AdminUserServiceImpl implements AdminUserService {
}
});
createReqVO.setUsername(createReqVO.getEmail());
validateUsernameUnique(null,createReqVO.getUsername());
// 1.2 校验正确性
validateUserForCreateOrUpdate(null, createReqVO.getUsername(),
createReqVO.getMobile(), createReqVO.getEmail(), createReqVO.getDeptId(), createReqVO.getPostIds());
@ -394,7 +395,9 @@ public class AdminUserServiceImpl implements AdminUserService {
}
// 如果 id 为空说明不用比较是否为相同 id 的用户
if (id == null) {
throw exception(USER_USERNAME_EXISTS);
if(username.equals(user.getUsername())){
throw exception(USER_USERNAME_EXISTS);
}
}
if (!user.getId().equals(id)) {
throw exception(USER_USERNAME_EXISTS);

View File

@ -130,7 +130,7 @@ const formLoading = ref(false) // 表单的加载中1修改时的数据加
const formType = ref('') // create - update -
const formData = ref({
nickname: '',
deptId: '',
deptId: 100,
mobile: '',
email: '',
id: undefined,
@ -221,7 +221,7 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
nickname: '',
deptId: '',
deptId: 100,
mobile: '',
email: '',
id: undefined,