Fix a lot of details.

This commit is contained in:
zicla
2018-01-01 17:44:25 +08:00
parent 8e5a85322e
commit 3cc4521882
4 changed files with 15 additions and 10 deletions

View File

@ -85,6 +85,11 @@ func (this *UserController) Login(writer http.ResponseWriter, request *http.Requ
Expires: expiration}
http.SetCookie(writer, &cookie)
//更新用户上次登录时间和ip
user.LastTime = time.Now()
user.LastIp = GetIpAddress(request)
this.userDao.Save(user)
return this.Success(user)
}
@ -105,6 +110,7 @@ func (this *UserController) Create(writer http.ResponseWriter, request *http.Req
panic("邮箱必填!")
}
avatarUrl := request.FormValue("avatarUrl")
phone := request.FormValue("phone")
gender := request.FormValue("gender")
role := request.FormValue("role")
@ -140,6 +146,7 @@ func (this *UserController) Create(writer http.ResponseWriter, request *http.Req
Phone: phone,
Gender: gender,
City: city,
AvatarUrl: avatarUrl,
SizeLimit: sizeLimit,
Status: USER_STATUS_OK,
}