This commit is contained in:
aozhiwei 2024-11-05 14:37:41 +08:00
parent ac06dafdde
commit b002811a82

View File

@ -1,6 +1,7 @@
package user
import (
"q5"
"f5"
"main/constant"
"main/common"
@ -23,6 +24,16 @@ func (this *UserApi) Login(c *gin.Context) {
user, "account_id = ?", s.GetAccountId()); result.Error != nil {
f5.RspErr(c, 500, "server internal error")
return
} else if result.RowsAffected <= 0{
nowTime := f5.GetApp().GetRealSeconds()
user.AccountId = s.GetAccountId()
user.Avatar = ""
user.NickName = s.GetNickName()
user.Score = ""
user.Dice = 0
user.CreateTime = q5.ToInt32(nowTime)
user.ModifyTime = q5.ToInt32(nowTime)
}
userVo.FromModel(user)
c.JSON(200, userVo)
}