|
|
@@ -8,6 +8,7 @@ import java.util.List;
|
|
|
import java.util.Set;
|
|
|
import javax.persistence.*;
|
|
|
|
|
|
+import com.uas.sso.core.Const;
|
|
|
import org.codehaus.jackson.annotate.JsonIgnore;
|
|
|
|
|
|
/**
|
|
|
@@ -89,7 +90,7 @@ public class User implements Serializable {
|
|
|
/**
|
|
|
* 用户邮箱
|
|
|
*/
|
|
|
- @Column(name = "user_email")
|
|
|
+ @Column(name = "user_email", unique = true)
|
|
|
private String email;
|
|
|
|
|
|
/**
|
|
|
@@ -192,8 +193,7 @@ public class User implements Serializable {
|
|
|
* 用户登录记录
|
|
|
*/
|
|
|
@com.fasterxml.jackson.annotation.JsonIgnore
|
|
|
- @OneToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
|
|
|
- @JoinColumn(name = "record_id")
|
|
|
+ @OneToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}, mappedBy = "user")
|
|
|
private UserRecord userRecord;
|
|
|
|
|
|
/**
|
|
|
@@ -294,6 +294,9 @@ public class User implements Serializable {
|
|
|
}
|
|
|
|
|
|
public String getEmail() {
|
|
|
+ if (email.contains(Const.REPEAT_SEPARATOR)) {
|
|
|
+ return email.substring(0, email.indexOf(Const.REPEAT_SEPARATOR));
|
|
|
+ }
|
|
|
return email;
|
|
|
}
|
|
|
|