style: 修改用户来源标识

This commit is contained in:
shiziyuan9527 2020-07-14 15:36:17 +08:00
parent 9045102e21
commit 327e06f0b7
4 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
package io.metersphere.commons.constants;
public enum UserSource {
Local, Ldap
LOCAL, LDAP
}

View File

@ -56,7 +56,7 @@ public class LdapController {
user.setName(username);
user.setEmail(email);
user.setPassword(password);
user.setSource(UserSource.Ldap.name());
user.setSource(UserSource.LDAP.name());
userService.addLdapUser(user);
} else {
request.setUsername(u.getId());

View File

@ -138,7 +138,7 @@ public class UserService {
user.setUpdateTime(System.currentTimeMillis());
// 默认1:启用状态
user.setStatus(UserStatus.NORMAL);
user.setSource(UserSource.Local.name());
user.setSource(UserSource.LOCAL.name());
// 密码使用 MD5
user.setPassword(CodingUtil.md5(user.getPassword()));
checkEmailIsExist(user.getEmail());

View File

@ -1,3 +1,3 @@
alter table user add source varchar(50) null;
update user set source = 'Local' where source is null;
update user set source = 'LOCAL' where source is null;