feat(user): 添加昵称字段
This commit is contained in:
1 parent
b24e1e41d7
commit
85265abb48
10 files changed
+292
-5
No files matched your search
@@ -27,6 +27,9 @@ func (User) Fields() []ent.Field {
|
||||
NotEmpty(),
|
||||
field.String("password").
|
||||
Sensitive(),
|
||||
field.String("nickname").
|
||||
Optional().
|
||||
MaxLen(64),
|
||||
field.String("email").
|
||||
Optional().
|
||||
Match(regexp.MustCompile(`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`)), // 邮箱格式正则校验
|
||||
|
||||
Reference in new issue
Block a user