mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 10:13:44 +08:00
feat: allow user to login with username and mobile no
This commit is contained in:
@@ -143,7 +143,7 @@ func (h *UserHandler) Login(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
var user model.User
|
||||
res := h.db.Where("username = ?", data.Username).First(&user)
|
||||
res := h.db.Where("username = ? OR mobile = ?", data.Username, data.Username).First(&user)
|
||||
if res.Error != nil {
|
||||
resp.ERROR(c, "用户名不存在")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user