更新用户登录
This commit is contained in:
@@ -107,6 +107,7 @@ func UserLogin(c *gin.Context) {
|
||||
Telephone: phoneInfo.PhoneNumber,
|
||||
// 若还有 password、avatar_url、birthdate、bio 等字段需要赋值,可在此补充
|
||||
// 比如 Password: "默认密码"(实际中密码应加密存储),AvatarUrl: "默认头像地址" 等
|
||||
Birthdate: nil,
|
||||
}
|
||||
|
||||
if err := databaseInit.UserDB.Create(&newUser).Error; err != nil {
|
||||
@@ -185,7 +186,7 @@ type UserInfo struct {
|
||||
Password string `gorm:"column:password"`
|
||||
AvatarUrl string `gorm:"column:avatar_url"`
|
||||
Gender int `gorm:"column:gender"`
|
||||
Birthdate time.Time `gorm:"column:birthdate;type:datetime"`
|
||||
Birthdate *time.Time `gorm:"column:birthdate-date;type:datetime;nullable"`
|
||||
CreatedTime time.Time `gorm:"column:createdtime;type:datetime"`
|
||||
UpdatedTime time.Time `gorm:"column:updatedtime;type:datetime"`
|
||||
Bio string `gorm:"column:bio"`
|
||||
|
||||
Reference in New Issue
Block a user