1
This commit is contained in:
parent
a78458ace3
commit
55f53c1d82
@ -21,7 +21,10 @@ func (this *UserApi) Login(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
user := new(model.User)
|
||||
userVo := new(vo.User)
|
||||
rspObj := struct {
|
||||
vo.BaseVo
|
||||
UserInfo vo.User `json:"user_info"`
|
||||
}{}
|
||||
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(user.TableName()).Take(
|
||||
user, "account_id = ?", s.GetAccountId()); result.Error != nil &&
|
||||
!errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||
@ -41,6 +44,6 @@ func (this *UserApi) Login(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
userVo.FromModel(user)
|
||||
c.JSON(200, userVo)
|
||||
rspObj.UserInfo.FromModel(user)
|
||||
c.JSON(200, rspObj)
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
BaseVo
|
||||
AccountId string `json:"account_id"`
|
||||
NickName string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user