This commit is contained in:
wucongxing8150 2024-09-04 16:19:53 +08:00
parent 2f12ff1e26
commit 33a76999b9
2 changed files with 8 additions and 2 deletions

View File

@ -107,7 +107,7 @@ func (r *Login) Login(c *gin.Context) {
// 新增用户
user = &model.User{
UserName: req.Nickname,
UserName: "",
AppIden: req.Uuid,
Mobile: req.Mobile,
RegisterSource: req.Source,
@ -183,6 +183,13 @@ func (r *Login) Login(c *gin.Context) {
tx.Commit()
// 获取用户信息
user, err = userDao.GetUser(maps)
if err != nil {
responses.FailWithMessage(err.Error(), c)
return
}
// 下发token
token := &utils.Token{
UserId: fmt.Sprintf("%d", user.UserId),

View File

@ -10,7 +10,6 @@ type Login struct {
Code string `json:"code" form:"code" label:"验证码"`
Source int `json:"source" form:"source" label:"来源" validate:"required"` // 1app 2公众号
OpenId string `json:"openid" form:"openid" label:"openid"`
Nickname string `json:"nickname" form:"nickname" label:"用户昵称"`
HeadImgUrl string `json:"headimgurl" form:"headimgurl" label:"头像"`
UnionId string `json:"unionid" form:"unionid" label:"unionid"`
Uuid string `json:"uuid" form:"uuid" label:"app唯一标识"`